Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored and EthanSteinberg committed Oct 21, 2022
1 parent e400014 commit 9dd5de5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
/// further ABI-incompatible changes may be made before the ABI is officially
/// changed to the new version.
#ifndef PYBIND11_INTERNALS_VERSION
# define PYBIND11_INTERNALS_VERSION 5
# define PYBIND11_INTERNALS_VERSION 4
#endif

#ifndef PYBIND11_LOCAL_INTERNALS_VERSION
# define PYBIND11_LOCAL_INTERNALS_VERSION 1
#endif

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
Expand Down Expand Up @@ -477,7 +481,7 @@ PYBIND11_NOINLINE internals &get_internals() {
struct local_internals {
type_map<type_info *> registered_types_cpp;
std::forward_list<ExceptionTranslator> registered_exception_translators;
#if defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION >= 4
#if defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION == 4

// For ABI compatibility, we can't store the loader_life_support TLS key in
// the `internals` struct directly. Instead, we store it in `shared_data` and
Expand Down Expand Up @@ -509,9 +513,10 @@ struct local_internals {
loader_life_support_tls_key
= static_cast<shared_loader_life_support_data *>(ptr)->loader_life_support_tls_key;
}
#endif // defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION >= 4
#if PYBIND11_INTERNALS_VERSION == 5
const char* function_capsule_name = strdup("pybind11_function_capsule");
#endif // defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION == 4

#if PYBIND11_LOCAL_INTERNALS_VERSION >= 1
const char *function_capsule_name = strdup("pybind11_function_capsule");
#endif
};

Expand All @@ -526,8 +531,8 @@ inline local_internals &get_local_internals() {
return *locals;
}

inline const char* get_function_capsule_name() {
#if PYBIND11_INTERNALS_VERSION == 5
inline const char *get_function_capsule_name() {
#if PYBIND11_LOCAL_INTERNALS_VERSION >= 1
return get_local_internals().function_capsule_name;
#else
return nullptr;
Expand Down

0 comments on commit 9dd5de5

Please sign in to comment.