Skip to content

Commit e9d6e87

Browse files
crest01wjakob
authored andcommitted
Added a debug flag to the PYBIND11_INTERNALS_VERSION (#1549)
1 parent 63c2a97 commit e9d6e87

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/pybind11/detail/internals.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,23 @@ 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)
144+
# define PYBIND11_BUILD_TYPE "_debug"
145+
#else
146+
# define PYBIND11_BUILD_TYPE ""
147+
#endif
148+
143149
#if defined(WITH_THREAD)
144150
# define PYBIND11_INTERNALS_KIND ""
145151
#else
146152
# define PYBIND11_INTERNALS_KIND "_without_thread"
147153
#endif
148154

149155
#define PYBIND11_INTERNALS_ID "__pybind11_internals_v" \
150-
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__"
156+
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__"
151157

152158
#define PYBIND11_MODULE_LOCAL_ID "__pybind11_module_local_v" \
153-
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__"
159+
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__"
154160

155161
/// Each module locally stores a pointer to the `internals` data. The data
156162
/// itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.

0 commit comments

Comments
 (0)