Skip to content

Commit 14f8425

Browse files
committed
THIS IS JUST A START: First attempt to combine information from PR pybind#4953 and PR pybind#5437
1 parent a90e2af commit 14f8425

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

include/pybind11/conduit/pybind11_platform_abi_id.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@
5454
#endif
5555

5656
#ifndef PYBIND11_BUILD_ABI
57-
# if defined(__GXX_ABI_VERSION) // Linux/OSX.
58-
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(__GXX_ABI_VERSION)
59-
# elif defined(_MSC_VER) // See PR #4953.
57+
# if defined(_MSC_VER) // See PR #4953.
6058
# if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd.
6159
# if (_MSC_VER) / 100 == 19
6260
# define PYBIND11_BUILD_ABI "_md_mscver19"
@@ -72,8 +70,17 @@
7270
# error "Unknown major version for MSC_VER: PLEASE REVISE THIS CODE."
7371
# endif
7472
# endif
75-
# elif defined(__NVCOMPILER) // NVHPC (PGI-based).
76-
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
73+
# elif defined(__NVCOMPILER) // NVHPC (PGI-based).
74+
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
75+
# elif defined(_LIBCPP_ABI_VERSION) // https://libcxx.llvm.org/DesignDocs/ABIVersioning.html
76+
# define PYBIND11_BUILD_ABI "_libcpp" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_LIBCPP_ABI_VERSION)
77+
# elif defined(__GXX_ABI_VERSION)
78+
# if __GXX_ABI_VERSION >= 1002 && defined(_GLIBCXX_USE_CXX11_ABI)
79+
# define PYBIND11_BUILD_ABI \
80+
"_usecxx11" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_GLIBCXX_USE_CXX11_ABI)
81+
# else
82+
# error "Unknown platform or compiler (__GXX_ABI_VERSION): PLEASE REVISE THIS CODE."
83+
# endif
7784
# else
7885
# error "Unknown platform or compiler: PLEASE REVISE THIS CODE."
7986
# endif

0 commit comments

Comments
 (0)