diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 93489c7a84..2e81150f16 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -232,11 +232,11 @@ # define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF #endif -// Slightly faster code paths are available when PYBIND11_SUBINTERPRETER_SUPPORT is *not* defined, -// so avoid defining it for implementations that do not support subinterpreters. -// However, defining it unnecessarily is not expected to break anything. +// Slightly faster code paths are available when PYBIND11_HAS_SUBINTERPRETER_SUPPORT is *not* +// defined, so avoid defining it for implementations that do not support subinterpreters. However, +// defining it unnecessarily is not expected to break anything. #if PY_VERSION_HEX >= 0x030C0000 && !defined(PYPY_VERSION) && !defined(GRAALVM_PYTHON) -# define PYBIND11_SUBINTERPRETER_SUPPORT +# define PYBIND11_HAS_SUBINTERPRETER_SUPPORT #endif // 3.12 Compatibility diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index 395ffbcb51..123460308d 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -324,7 +324,7 @@ inline std::atomic &get_num_interpreters_seen() { template inline std::unique_ptr *&get_internals_pp() { -#ifdef PYBIND11_SUBINTERPRETER_SUPPORT +#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT if (get_num_interpreters_seen() > 1) { // Internals is one per interpreter. When multiple interpreters are alive in different // threads we have to allow them to have different internals, so we need a thread_local. diff --git a/include/pybind11/subinterpreter.h b/include/pybind11/subinterpreter.h index 306e47bc6a..784e09c536 100644 --- a/include/pybind11/subinterpreter.h +++ b/include/pybind11/subinterpreter.h @@ -15,7 +15,7 @@ #include -#if !defined(PYBIND11_SUBINTERPRETER_SUPPORT) +#if !defined(PYBIND11_HAS_SUBINTERPRETER_SUPPORT) # error "This platform does not support subinterpreters, do not include this file." #endif diff --git a/tests/test_embed/test_subinterpreter.cpp b/tests/test_embed/test_subinterpreter.cpp index 9d7d88b8a0..9614a76cd5 100644 --- a/tests/test_embed/test_subinterpreter.cpp +++ b/tests/test_embed/test_subinterpreter.cpp @@ -1,5 +1,5 @@ #include -#ifdef PYBIND11_SUBINTERPRETER_SUPPORT +#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT # include // Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to @@ -428,4 +428,4 @@ TEST_CASE("Per-Subinterpreter GIL") { } # endif // Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#endif // PYBIND11_SUBINTERPRETER_SUPPORT +#endif // PYBIND11_HAS_SUBINTERPRETER_SUPPORT