ext: Fix undefined macro in pybind
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 27 Feb 2017 13:17:51 +0000 (13:17 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 2 May 2017 12:37:32 +0000 (12:37 +0000)
Change-Id: I63a2506d3c028f78cacce8308e2f0e4880531dec
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2230
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Pierre-Yves PĂ©neau <pierre-yves.peneau@lirmm.fr>
ext/pybind11/include/pybind11/common.h
ext/pybind11/include/pybind11/stl.h

index 712c1a5d62668c65ee910b0f38082c44fa5b8a93..f7a383007a749c5634dbbcd56ecaa3a34650ab94 100644 (file)
@@ -558,7 +558,8 @@ PYBIND11_DECL_FMT(bool, "?");
 struct nodelete { template <typename T> void operator()(T*) { } };
 
 // overload_cast requires variable templates: C++14 or MSVC 2015 Update 2
-#if defined(PYBIND11_CPP14) || _MSC_FULL_VER >= 190023918
+#if defined(PYBIND11_CPP14) || ( \
+    defined(_MSC_FULL_VER) &&_MSC_FULL_VER >= 190023918)
 #define PYBIND11_OVERLOAD_CAST 1
 
 NAMESPACE_BEGIN(detail)
index d4b0fc914abacfd293647ff9d550fa78bc195db4..7d6e8b10274c0c88ecf2ddc2e5ed0dd1e5a56c76 100644 (file)
@@ -246,7 +246,7 @@ template<typename T> struct optional_caster {
     PYBIND11_TYPE_CASTER(T, _("Optional[") + value_conv::name() + _("]"));
 };
 
-#if PYBIND11_HAS_OPTIONAL
+#ifdef PYBIND11_HAS_OPTIONAL
 template<typename T> struct type_caster<std::optional<T>>
     : public optional_caster<std::optional<T>> {};
 
@@ -254,7 +254,7 @@ template<> struct type_caster<std::nullopt_t>
     : public void_caster<std::nullopt_t> {};
 #endif
 
-#if PYBIND11_HAS_EXP_OPTIONAL
+#ifdef PYBIND11_HAS_EXP_OPTIONAL
 template<typename T> struct type_caster<std::experimental::optional<T>>
     : public optional_caster<std::experimental::optional<T>> {};