Skip to content

Commit 9dd5de5

Browse files
pre-commit-ci[bot]EthanSteinberg
authored andcommitted
style: pre-commit fixes
1 parent e400014 commit 9dd5de5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

include/pybind11/detail/internals.h

+12-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
/// further ABI-incompatible changes may be made before the ABI is officially
2929
/// changed to the new version.
3030
#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
3236
#endif
3337

3438
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
@@ -477,7 +481,7 @@ PYBIND11_NOINLINE internals &get_internals() {
477481
struct local_internals {
478482
type_map<type_info *> registered_types_cpp;
479483
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
481485

482486
// For ABI compatibility, we can't store the loader_life_support TLS key in
483487
// the `internals` struct directly. Instead, we store it in `shared_data` and
@@ -509,9 +513,10 @@ struct local_internals {
509513
loader_life_support_tls_key
510514
= static_cast<shared_loader_life_support_data *>(ptr)->loader_life_support_tls_key;
511515
}
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");
515520
#endif
516521
};
517522

@@ -526,8 +531,8 @@ inline local_internals &get_local_internals() {
526531
return *locals;
527532
}
528533

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
531536
return get_local_internals().function_capsule_name;
532537
#else
533538
return nullptr;

0 commit comments

Comments
 (0)