Skip to content

Commit 271720f

Browse files
committed
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.
1 parent 476c322 commit 271720f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/pybind11/conduit/pybind11_platform_abi_id.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@
7575
# elif defined(_LIBCPP_ABI_VERSION) // https://libcxx.llvm.org/DesignDocs/ABIVersioning.html
7676
# define PYBIND11_BUILD_ABI "_abi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_LIBCPP_ABI_VERSION)
7777
# elif defined(__GXX_ABI_VERSION)
78-
# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000 \
79-
&& defined(_GLIBCXX_USE_CXX11_ABI)
78+
# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000
79+
# if !defined(_GLIBCXX_USE_CXX11_ABI)
80+
# error "UNEXPECTED: _GLIBCXX_USE_CXX11_ABI not defined"
81+
# endif
8082
# define PYBIND11_BUILD_ABI \
8183
"_gxx_abi_1xxx_usecxx11_" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_GLIBCXX_USE_CXX11_ABI)
8284
# else

0 commit comments

Comments
 (0)