From 271720fde97f72d0c0002619114bd9edea5bc95f Mon Sep 17 00:00:00 2001 From: "Marcus D. Hanwell" Date: Wed, 20 Nov 2024 20:10:08 -0500 Subject: [PATCH] Error if `_GLIBCXX_USE_CXX11_ABI` is not defined Within the `__GXX_ABI_VERSION` block this should always be defined, guard against unexpected defines and make the error obvious. --- include/pybind11/conduit/pybind11_platform_abi_id.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pybind11/conduit/pybind11_platform_abi_id.h b/include/pybind11/conduit/pybind11_platform_abi_id.h index 9f173c91d..7e9b801d3 100644 --- a/include/pybind11/conduit/pybind11_platform_abi_id.h +++ b/include/pybind11/conduit/pybind11_platform_abi_id.h @@ -75,8 +75,10 @@ # elif defined(_LIBCPP_ABI_VERSION) // https://libcxx.llvm.org/DesignDocs/ABIVersioning.html # define PYBIND11_BUILD_ABI "_abi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_LIBCPP_ABI_VERSION) # elif defined(__GXX_ABI_VERSION) -# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000 \ - && defined(_GLIBCXX_USE_CXX11_ABI) +# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000 +# if !defined(_GLIBCXX_USE_CXX11_ABI) +# error "UNEXPECTED: _GLIBCXX_USE_CXX11_ABI not defined" +# endif # define PYBIND11_BUILD_ABI \ "_gxx_abi_1xxx_usecxx11_" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_GLIBCXX_USE_CXX11_ABI) # else