Skip to content

Commit 41daaa4

Browse files
committed
Make determination of PYBIND11_COMPILER_TYPE "macos" or "glibc" more general.
The main motivation is to resolve these "Manylinux on 🐍 3.13t • GIL" and "Pyodide wheel" failures: ``` /__w/pybind11/pybind11/include/pybind11/conduit/pybind11_platform_abi_id.h:35:10: error: #error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE." 35 | # error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE." | ^~~~~ ``` (All other CI jobs succeeded.) Further thought: Essentially, under Linux and macOS the `PYBIND11_COMPILER_TYPE` is only for informational purposes. ABI compatibility is determined by the libstdc++ or libc++ ABI version.
1 parent ca9e699 commit 41daaa4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

include/pybind11/conduit/pybind11_platform_abi_id.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@
2323
# define PYBIND11_COMPILER_TYPE "gcc_cygwin"
2424
# elif defined(_MSC_VER)
2525
# define PYBIND11_COMPILER_TYPE "msvc"
26-
# elif defined(__GLIBC__) \
27-
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
28-
// // Compatibility is determined based on libstdc++ or libc++ ABI version (below).
29-
# define PYBIND11_COMPILER_TYPE "glibc"
30-
# elif defined(__APPLE__) \
31-
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
32-
// // Compatibility is (usually) determined based on libc++ ABI version (below).
26+
# elif defined(__APPLE__)
3327
# define PYBIND11_COMPILER_TYPE "macos"
28+
# elif defined(__GLIBC__) || defined(_GLIBCXX_USE_CXX11_ABI)
29+
# define PYBIND11_COMPILER_TYPE "glibc"
3430
# else
3531
# error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
3632
# endif

0 commit comments

Comments
 (0)