|
28 | 28 | # endif
|
29 | 29 | #endif
|
30 | 30 |
|
| 31 | +// Compiler version assertions |
| 32 | +#if defined(__INTEL_COMPILER) |
| 33 | +# if __INTEL_COMPILER < 1500 |
| 34 | +# error pybind11 requires Intel C++ compiler v15 or newer |
| 35 | +# endif |
| 36 | +#elif defined(__clang__) && !defined(__apple_build_version__) |
| 37 | +# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3) |
| 38 | +# error pybind11 requires clang 3.3 or newer |
| 39 | +# endif |
| 40 | +#elif defined(__clang__) |
| 41 | +// Apple changes clang version macros to its Xcode version; the first Xcode release based on |
| 42 | +// (upstream) clang 3.3 was Xcode 5: |
| 43 | +# if __clang_major__ < 5 |
| 44 | +# error pybind11 requires Xcode/clang 5.0 or newer |
| 45 | +# endif |
| 46 | +#elif defined(__GNUG__) |
| 47 | +# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) |
| 48 | +# error pybind11 requires gcc 4.8 or newer |
| 49 | +# endif |
| 50 | +#elif defined(_MSC_VER) |
| 51 | +// Pybind hits various compiler bugs in 2015u2 and earlier, and also makes use of some stl features |
| 52 | +// (e.g. std::negation) added in 2015u3: |
| 53 | +# if _MSC_FULL_VER < 190024213 |
| 54 | +# error pybind11 requires MSVC 2015 update 3 or newer |
| 55 | +# endif |
| 56 | +#endif |
| 57 | + |
31 | 58 | #if !defined(PYBIND11_EXPORT)
|
32 | 59 | # if defined(WIN32) || defined(_WIN32)
|
33 | 60 | # define PYBIND11_EXPORT __declspec(dllexport)
|
@@ -651,8 +678,8 @@ struct error_scope {
|
651 | 678 | /// Dummy destructor wrapper that can be used to expose classes with a private destructor
|
652 | 679 | struct nodelete { template <typename T> void operator()(T*) { } };
|
653 | 680 |
|
654 |
| -// overload_cast requires variable templates: C++14 or MSVC 2015 Update 2 |
655 |
| -#if defined(PYBIND11_CPP14) || _MSC_FULL_VER >= 190023918 |
| 681 | +// overload_cast requires variable templates: C++14 or MSVC |
| 682 | +#if defined(PYBIND11_CPP14) || defined(_MSC_VER) |
656 | 683 | #define PYBIND11_OVERLOAD_CAST 1
|
657 | 684 |
|
658 | 685 | NAMESPACE_BEGIN(detail)
|
|
0 commit comments