28
28
// / further ABI-incompatible changes may be made before the ABI is officially
29
29
// / changed to the new version.
30
30
#ifndef PYBIND11_INTERNALS_VERSION
31
- # define PYBIND11_INTERNALS_VERSION 5
31
+ # define PYBIND11_INTERNALS_VERSION 4
32
+ #endif
33
+
34
+ #ifndef PYBIND11_LOCAL_INTERNALS_VERSION
35
+ # define PYBIND11_LOCAL_INTERNALS_VERSION 1
32
36
#endif
33
37
34
38
PYBIND11_NAMESPACE_BEGIN (PYBIND11_NAMESPACE)
@@ -477,7 +481,7 @@ PYBIND11_NOINLINE internals &get_internals() {
477
481
struct local_internals {
478
482
type_map<type_info *> registered_types_cpp;
479
483
std::forward_list<ExceptionTranslator> registered_exception_translators;
480
- #if defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION > = 4
484
+ #if defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION = = 4
481
485
482
486
// For ABI compatibility, we can't store the loader_life_support TLS key in
483
487
// the `internals` struct directly. Instead, we store it in `shared_data` and
@@ -509,9 +513,10 @@ struct local_internals {
509
513
loader_life_support_tls_key
510
514
= static_cast <shared_loader_life_support_data *>(ptr)->loader_life_support_tls_key ;
511
515
}
512
- #endif // defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION >= 4
513
- #if PYBIND11_INTERNALS_VERSION == 5
514
- const char * function_capsule_name = strdup(" pybind11_function_capsule" );
516
+ #endif // defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION == 4
517
+
518
+ #if PYBIND11_LOCAL_INTERNALS_VERSION >= 1
519
+ const char *function_capsule_name = strdup(" pybind11_function_capsule" );
515
520
#endif
516
521
};
517
522
@@ -526,8 +531,8 @@ inline local_internals &get_local_internals() {
526
531
return *locals;
527
532
}
528
533
529
- inline const char * get_function_capsule_name () {
530
- #if PYBIND11_INTERNALS_VERSION == 5
534
+ inline const char * get_function_capsule_name () {
535
+ #if PYBIND11_LOCAL_INTERNALS_VERSION >= 1
531
536
return get_local_internals ().function_capsule_name ;
532
537
#else
533
538
return nullptr ;
0 commit comments