File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -289,15 +289,15 @@ template<typename T> struct optional_caster {
289
289
PYBIND11_TYPE_CASTER (T, _(" Optional[" ) + value_conv::name + _(" ]" ));
290
290
};
291
291
292
- #if PYBIND11_HAS_OPTIONAL
292
+ #if defined( PYBIND11_HAS_OPTIONAL)
293
293
template <typename T> struct type_caster <std::optional<T>>
294
294
: public optional_caster<std::optional<T>> {};
295
295
296
296
template <> struct type_caster <std::nullopt_t >
297
297
: public void_caster<std::nullopt_t > {};
298
298
#endif
299
299
300
- #if PYBIND11_HAS_EXP_OPTIONAL
300
+ #if defined( PYBIND11_HAS_EXP_OPTIONAL)
301
301
template <typename T> struct type_caster <std::experimental::optional<T>>
302
302
: public optional_caster<std::experimental::optional<T>> {};
303
303
@@ -369,7 +369,7 @@ struct variant_caster<V<Ts...>> {
369
369
PYBIND11_TYPE_CASTER (Type, _(" Union[" ) + detail::concat(make_caster<Ts>::name...) + _(" ]" ));
370
370
};
371
371
372
- #if PYBIND11_HAS_VARIANT
372
+ #if defined( PYBIND11_HAS_VARIANT)
373
373
template <typename ... Ts>
374
374
struct type_caster <std::variant<Ts...>> : variant_caster<std::variant<Ts...>> { };
375
375
#endif
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ function(pybind11_enable_warnings target_name)
216
216
target_compile_options (${target_name} PRIVATE /W4 )
217
217
elseif (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)" AND NOT PYBIND11_CUDA_TESTS )
218
218
target_compile_options (${target_name} PRIVATE -Wall -Wextra -Wconversion -Wcast-qual
219
- -Wdeprecated )
219
+ -Wdeprecated -Wundef )
220
220
endif ()
221
221
222
222
if (PYBIND11_WERROR )
Original file line number Diff line number Diff line change @@ -88,11 +88,11 @@ std::string abs(const Vector2&) {
88
88
// Here, we suppress the warning using `#pragma diagnostic`.
89
89
// Taken from: https://github.com/RobotLocomotion/drake/commit/aaf84b46
90
90
// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).
91
- #if (__APPLE__) && (__clang__)
91
+ #if defined (__APPLE__) && defined (__clang__)
92
92
#if (__clang_major__ >= 10) && (__clang_minor__ >= 0) && (__clang_patchlevel__ >= 1)
93
93
#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
94
94
#endif
95
- #elif (__clang__)
95
+ #elif defined (__clang__)
96
96
#if (__clang_major__ >= 7)
97
97
#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
98
98
#endif
Original file line number Diff line number Diff line change 15
15
#include < string>
16
16
17
17
// Test with `std::variant` in C++17 mode, or with `boost::variant` in C++11/14
18
- #if PYBIND11_HAS_VARIANT
18
+ #if defined( PYBIND11_HAS_VARIANT)
19
19
using std::variant;
20
20
#elif defined(PYBIND11_TEST_BOOST) && (!defined(_MSC_VER) || _MSC_VER >= 1910)
21
21
# include < boost/variant.hpp>
You can’t perform that action at this time.
0 commit comments