File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -140,23 +140,31 @@ struct type_info {
140140// / Tracks the `internals` and `type_info` ABI version independent of the main library version
141141#define PYBIND11_INTERNALS_VERSION 3
142142
143- #if defined(_DEBUG)
143+ // / On MSVC, debug and release builds are not ABI-compatible!
144+ #if defined(_MSC_VER) && defined(_DEBUG)
144145# define PYBIND11_BUILD_TYPE " _debug"
145146#else
146147# define PYBIND11_BUILD_TYPE " "
147148#endif
148149
150+ // / On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
151+ #if defined(__GXX_ABI_VERSION)
152+ # define PYBIND11_BUILD_ABI " _cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
153+ #else
154+ # define PYBIND11_BUILD_ABI " "
155+ #endif
156+
149157#if defined(WITH_THREAD)
150158# define PYBIND11_INTERNALS_KIND " "
151159#else
152160# define PYBIND11_INTERNALS_KIND " _without_thread"
153161#endif
154162
155163#define PYBIND11_INTERNALS_ID " __pybind11_internals_v" \
156- PYBIND11_TOSTRING (PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__"
164+ PYBIND11_TOSTRING (PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_ABI PYBIND11_BUILD_TYPE "__"
157165
158166#define PYBIND11_MODULE_LOCAL_ID " __pybind11_module_local_v" \
159- PYBIND11_TOSTRING (PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__"
167+ PYBIND11_TOSTRING (PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_ABI PYBIND11_BUILD_TYPE "__"
160168
161169// / Each module locally stores a pointer to the `internals` data. The data
162170// / itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.
You can’t perform that action at this time.
0 commit comments