From e9d6e879499d56c26e7a55424e499b24a5047c36 Mon Sep 17 00:00:00 2001 From: Karl Haubenwallner Date: Sun, 11 Nov 2018 20:47:26 +0100 Subject: [PATCH] Added a debug flag to the PYBIND11_INTERNALS_VERSION (#1549) --- include/pybind11/detail/internals.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index ad3441576..6d7dc5cfe 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -140,6 +140,12 @@ struct type_info { /// Tracks the `internals` and `type_info` ABI version independent of the main library version #define PYBIND11_INTERNALS_VERSION 3 +#if defined(_DEBUG) +# define PYBIND11_BUILD_TYPE "_debug" +#else +# define PYBIND11_BUILD_TYPE "" +#endif + #if defined(WITH_THREAD) # define PYBIND11_INTERNALS_KIND "" #else @@ -147,10 +153,10 @@ struct type_info { #endif #define PYBIND11_INTERNALS_ID "__pybind11_internals_v" \ - PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__" + PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__" #define PYBIND11_MODULE_LOCAL_ID "__pybind11_module_local_v" \ - PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__" + PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND PYBIND11_BUILD_TYPE "__" /// Each module locally stores a pointer to the `internals` data. The data /// itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.