Skip to content

Commit e31ec0b

Browse files
committed
Switch to ifdef instead of if
1 parent edf6933 commit e31ec0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/pybind11/detail/internals.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class internals_pp_manager {
513513
/// Get the current pointer-to-pointer, allocating it if it does not already exist. May
514514
/// acquire the GIL. Will never return nullptr.
515515
std::unique_ptr<InternalsType> *get_pp() {
516-
#if PYBIND11_HAS_SUBINTERPRETER_SUPPORT
516+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
517517
if (get_num_interpreters_seen() > 1) {
518518
// Whenever the interpreter changes on the current thread we need to invalidate the
519519
// internals_pp so that it can be pulled from the interpreter's state dict. That is
@@ -539,15 +539,15 @@ class internals_pp_manager {
539539

540540
/// Drop all the references we're currently holding.
541541
void unref() {
542-
#if PYBIND11_HAS_SUBINTERPRETER_SUPPORT
542+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
543543
last_istate_.reset();
544544
internals_tls_p_.reset();
545545
#endif
546546
internals_singleton_pp_ = nullptr;
547547
}
548548

549549
void destroy() {
550-
#if PYBIND11_HAS_SUBINTERPRETER_SUPPORT
550+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
551551
if (get_num_interpreters_seen() > 1) {
552552
auto *tstate = get_thread_state_unchecked();
553553
// this could be called without an active interpreter, just use what was cached
@@ -593,7 +593,7 @@ class internals_pp_manager {
593593

594594
char const *holder_id_ = nullptr;
595595
on_fetch_function *on_fetch_ = nullptr;
596-
#if PYBIND11_HAS_SUBINTERPRETER_SUPPORT
596+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
597597
thread_specific_storage<PyInterpreterState> last_istate_;
598598
thread_specific_storage<std::unique_ptr<InternalsType>> internals_tls_p_;
599599
#endif

0 commit comments

Comments
 (0)