Skip to content

Commit 98bd78f

Browse files
authored
chore: rename macro PYBIND11_SUBINTERPRETER_SUPPORT -> PYBIND11_HAS_SUBINTERPRETER_SUPPORT to meet naming convention (#5682)
1 parent 8d503e3 commit 98bd78f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

include/pybind11/detail/common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@
232232
# define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
233233
#endif
234234

235-
// Slightly faster code paths are available when PYBIND11_SUBINTERPRETER_SUPPORT is *not* defined,
236-
// so avoid defining it for implementations that do not support subinterpreters.
237-
// However, defining it unnecessarily is not expected to break anything.
235+
// Slightly faster code paths are available when PYBIND11_HAS_SUBINTERPRETER_SUPPORT is *not*
236+
// defined, so avoid defining it for implementations that do not support subinterpreters. However,
237+
// defining it unnecessarily is not expected to break anything.
238238
#if PY_VERSION_HEX >= 0x030C0000 && !defined(PYPY_VERSION) && !defined(GRAALVM_PYTHON)
239-
# define PYBIND11_SUBINTERPRETER_SUPPORT
239+
# define PYBIND11_HAS_SUBINTERPRETER_SUPPORT
240240
#endif
241241

242242
// 3.12 Compatibility

include/pybind11/detail/internals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ inline std::atomic<int> &get_num_interpreters_seen() {
324324

325325
template <typename InternalsType>
326326
inline std::unique_ptr<InternalsType> *&get_internals_pp() {
327-
#ifdef PYBIND11_SUBINTERPRETER_SUPPORT
327+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
328328
if (get_num_interpreters_seen() > 1) {
329329
// Internals is one per interpreter. When multiple interpreters are alive in different
330330
// threads we have to allow them to have different internals, so we need a thread_local.

include/pybind11/subinterpreter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <stdexcept>
1717

18-
#if !defined(PYBIND11_SUBINTERPRETER_SUPPORT)
18+
#if !defined(PYBIND11_HAS_SUBINTERPRETER_SUPPORT)
1919
# error "This platform does not support subinterpreters, do not include this file."
2020
#endif
2121

tests/test_embed/test_subinterpreter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <pybind11/embed.h>
2-
#ifdef PYBIND11_SUBINTERPRETER_SUPPORT
2+
#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
33
# include <pybind11/subinterpreter.h>
44

55
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
@@ -428,4 +428,4 @@ TEST_CASE("Per-Subinterpreter GIL") {
428428
}
429429
# endif // Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
430430

431-
#endif // PYBIND11_SUBINTERPRETER_SUPPORT
431+
#endif // PYBIND11_HAS_SUBINTERPRETER_SUPPORT

0 commit comments

Comments
 (0)