File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3939 #define SOFAPYTHON3_API SOFA_IMPORT_DYNAMIC_LIBRARY
4040#endif
4141
42+ // define own pybind version macro, much easier to test/read
43+ #define PYBIND11_SOFA_VERSION (PYBIND11_VERSION_MAJOR * 10000 \
44+ + PYBIND11_VERSION_MINOR * 100 \
45+ + PYBIND11_VERSION_PATCH)
4246// pybind11 already bind the attributeError starting from 2.8.1 version.
4347// so if the version is >= 2.8.1, macro does nothing, otherwise bind attribute_error
44- #if not (PYBIND11_VERSION_MAJOR >= 2 && PYBIND11_VERSION_MINOR >= 8 && PYBIND11_VERSION_PATCH >= 1 )
45- #define SOFAPYTHON3_BIND_ATTRIBUTE_ERROR () namespace pybind11 { PYBIND11_RUNTIME_EXCEPTION(attribute_error, PyExc_AttributeError) }
46- #else
48+ #if PYBIND11_SOFA_VERSION >= 20801
4749#define SOFAPYTHON3_BIND_ATTRIBUTE_ERROR ()
48- #endif // not(PYBIND11_VERSION >= 2.8.1)
50+ #else
51+ #define SOFAPYTHON3_BIND_ATTRIBUTE_ERROR () namespace pybind11 { PYBIND11_RUNTIME_EXCEPTION(attribute_error, PyExc_AttributeError) }
52+ #endif // PYBIND11_SOFA_VERSION >= 20801
You can’t perform that action at this time.
0 commit comments