Add PYBIND11_ prefix to the THROW macro to prevent name collisions. (#1578)

This commit is contained in:
Michał Wawrzyniec Urbańczyk 2018-11-03 13:20:08 +01:00 committed by Wenzel Jakob
parent 741576dd11
commit 978d439e92

View File

@ -1464,12 +1464,12 @@ struct enum_base {
PYBIND11_ENUM_OP_STRICT("__ne__", !int_(a).equal(int_(b)), return true); PYBIND11_ENUM_OP_STRICT("__ne__", !int_(a).equal(int_(b)), return true);
if (is_arithmetic) { if (is_arithmetic) {
#define THROW throw type_error("Expected an enumeration of matching type!"); #define PYBIND11_THROW throw type_error("Expected an enumeration of matching type!");
PYBIND11_ENUM_OP_STRICT("__lt__", int_(a) < int_(b), THROW); PYBIND11_ENUM_OP_STRICT("__lt__", int_(a) < int_(b), PYBIND11_THROW);
PYBIND11_ENUM_OP_STRICT("__gt__", int_(a) > int_(b), THROW); PYBIND11_ENUM_OP_STRICT("__gt__", int_(a) > int_(b), PYBIND11_THROW);
PYBIND11_ENUM_OP_STRICT("__le__", int_(a) <= int_(b), THROW); PYBIND11_ENUM_OP_STRICT("__le__", int_(a) <= int_(b), PYBIND11_THROW);
PYBIND11_ENUM_OP_STRICT("__ge__", int_(a) >= int_(b), THROW); PYBIND11_ENUM_OP_STRICT("__ge__", int_(a) >= int_(b), PYBIND11_THROW);
#undef THROW #undef PYBIND11_THROW
} }
} }