|
10 | 10 | #pragma once
|
11 | 11 |
|
12 | 12 | #include "common.h"
|
| 13 | +#include "platform_abi_id.h" |
13 | 14 |
|
14 | 15 | #if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
|
15 | 16 | # include <pybind11/gil.h>
|
@@ -264,72 +265,13 @@ struct type_info {
|
264 | 265 | bool module_local : 1;
|
265 | 266 | };
|
266 | 267 |
|
267 |
| -/// On MSVC, debug and release builds are not ABI-compatible! |
268 |
| -#if defined(_MSC_VER) && defined(_DEBUG) |
269 |
| -# define PYBIND11_BUILD_TYPE "_debug" |
270 |
| -#else |
271 |
| -# define PYBIND11_BUILD_TYPE "" |
272 |
| -#endif |
273 |
| - |
274 |
| -/// Let's assume that different compilers are ABI-incompatible. |
275 |
| -/// A user can manually set this string if they know their |
276 |
| -/// compiler is compatible. |
277 |
| -#ifndef PYBIND11_COMPILER_TYPE |
278 |
| -# if defined(_MSC_VER) |
279 |
| -# define PYBIND11_COMPILER_TYPE "_msvc" |
280 |
| -# elif defined(__INTEL_COMPILER) |
281 |
| -# define PYBIND11_COMPILER_TYPE "_icc" |
282 |
| -# elif defined(__clang__) |
283 |
| -# define PYBIND11_COMPILER_TYPE "_clang" |
284 |
| -# elif defined(__PGI) |
285 |
| -# define PYBIND11_COMPILER_TYPE "_pgi" |
286 |
| -# elif defined(__MINGW32__) |
287 |
| -# define PYBIND11_COMPILER_TYPE "_mingw" |
288 |
| -# elif defined(__CYGWIN__) |
289 |
| -# define PYBIND11_COMPILER_TYPE "_gcc_cygwin" |
290 |
| -# elif defined(__GNUC__) |
291 |
| -# define PYBIND11_COMPILER_TYPE "_gcc" |
292 |
| -# else |
293 |
| -# define PYBIND11_COMPILER_TYPE "_unknown" |
294 |
| -# endif |
295 |
| -#endif |
296 |
| - |
297 |
| -/// Also standard libs |
298 |
| -#ifndef PYBIND11_STDLIB |
299 |
| -# if defined(_LIBCPP_VERSION) |
300 |
| -# define PYBIND11_STDLIB "_libcpp" |
301 |
| -# elif defined(__GLIBCXX__) || defined(__GLIBCPP__) |
302 |
| -# define PYBIND11_STDLIB "_libstdcpp" |
303 |
| -# else |
304 |
| -# define PYBIND11_STDLIB "" |
305 |
| -# endif |
306 |
| -#endif |
307 |
| - |
308 |
| -/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility. |
309 |
| -/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898). |
310 |
| -#ifndef PYBIND11_BUILD_ABI |
311 |
| -# if defined(__GXX_ABI_VERSION) |
312 |
| -# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION) |
313 |
| -# elif defined(_MSC_VER) |
314 |
| -# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER) |
315 |
| -# else |
316 |
| -# define PYBIND11_BUILD_ABI "" |
317 |
| -# endif |
318 |
| -#endif |
319 |
| - |
320 |
| -#ifndef PYBIND11_INTERNALS_KIND |
321 |
| -# define PYBIND11_INTERNALS_KIND "" |
322 |
| -#endif |
323 |
| - |
324 | 268 | #define PYBIND11_INTERNALS_ID \
|
325 | 269 | "__pybind11_internals_v" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) \
|
326 |
| - PYBIND11_INTERNALS_KIND PYBIND11_COMPILER_TYPE PYBIND11_STDLIB \ |
327 |
| - PYBIND11_BUILD_ABI PYBIND11_BUILD_TYPE "__" |
| 270 | + PYBIND11_PLATFORM_ABI_ID "__" |
328 | 271 |
|
329 | 272 | #define PYBIND11_MODULE_LOCAL_ID \
|
330 | 273 | "__pybind11_module_local_v" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) \
|
331 |
| - PYBIND11_INTERNALS_KIND PYBIND11_COMPILER_TYPE PYBIND11_STDLIB \ |
332 |
| - PYBIND11_BUILD_ABI PYBIND11_BUILD_TYPE "__" |
| 274 | + PYBIND11_PLATFORM_ABI_ID "__" |
333 | 275 |
|
334 | 276 | /// Each module locally stores a pointer to the `internals` data. The data
|
335 | 277 | /// itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.
|
|
0 commit comments