From ef83b3fc00716e16c54c7030326809c374c33161 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Nov 2023 04:24:33 +0100 Subject: gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111584) --- Include/moduleobject.h | 8 ++++---- Modules/_ctypes/_ctypes_test.c | 4 ++-- Modules/_multiprocessing/posixshmem.c | 4 ++-- Modules/_scproxy.c | 4 ++-- Modules/_stat.c | 2 +- Modules/_testclinic_limited.c | 2 +- Modules/_uuidmodule.c | 4 ++-- Modules/errnomodule.c | 4 ++-- Modules/md5module.c | 4 ++-- Modules/resource.c | 2 +- Modules/xxlimited.c | 4 ++-- PC/winsound.c | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Include/moduleobject.h b/Include/moduleobject.h index 2f7dc25..52a47f1 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -82,10 +82,10 @@ struct PyModuleDef_Slot { #endif /* New in 3.5 */ /* for Py_mod_multiple_interpreters: */ -#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 -#define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0) -#define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1) -#define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2) +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 +# define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0) +# define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1) +# define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2) #endif struct PyModuleDef { diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c index 12d372f..5869d8f 100644 --- a/Modules/_ctypes/_ctypes_test.c +++ b/Modules/_ctypes/_ctypes_test.c @@ -3,8 +3,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif // gh-85283: On Windows, Py_LIMITED_API requires Py_BUILD_CORE to not attempt diff --git a/Modules/_multiprocessing/posixshmem.c b/Modules/_multiprocessing/posixshmem.c index dc3c59d..b1f776c 100644 --- a/Modules/_multiprocessing/posixshmem.c +++ b/Modules/_multiprocessing/posixshmem.c @@ -5,8 +5,8 @@ posixshmem - A Python extension that provides shm_open() and shm_unlink() #include "pyconfig.h" // Py_NOGIL #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c index c8e120e..9f7a65c 100644 --- a/Modules/_scproxy.c +++ b/Modules/_scproxy.c @@ -8,8 +8,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include diff --git a/Modules/_stat.c b/Modules/_stat.c index d003560..9e278d6 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -15,8 +15,8 @@ #include "pyconfig.h" // Py_NOGIL #endif -// Need limited C API version 3.13 for PyModule_Add() on Windows #ifndef Py_NOGIL +// Need limited C API version 3.13 for PyModule_Add() on Windows #define Py_LIMITED_API 0x030d0000 #endif diff --git a/Modules/_testclinic_limited.c b/Modules/_testclinic_limited.c index 63ebb52..c5d07e1 100644 --- a/Modules/_testclinic_limited.c +++ b/Modules/_testclinic_limited.c @@ -8,8 +8,8 @@ #include "pyconfig.h" // Py_NOGIL #endif -// For now, only limited C API 3.13 is supported #ifndef Py_NOGIL +// For now, only limited C API 3.13 is supported #define Py_LIMITED_API 0x030d0000 #endif diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index 8bda1d6..1d71605 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -8,8 +8,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include "Python.h" diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c index 5ac4d29..1e2c55a 100644 --- a/Modules/errnomodule.c +++ b/Modules/errnomodule.c @@ -5,8 +5,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include "Python.h" diff --git a/Modules/md5module.c b/Modules/md5module.c index ff7fc09..7883a8c 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -21,8 +21,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include "Python.h" diff --git a/Modules/resource.c b/Modules/resource.c index eb9c2e2..87c4460 100644 --- a/Modules/resource.c +++ b/Modules/resource.c @@ -3,7 +3,7 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +// Need limited C API version 3.13 for PySys_Audit() #define Py_LIMITED_API 0x030d0000 #endif diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c index 3dcf74a..21d7e9b 100644 --- a/Modules/xxlimited.c +++ b/Modules/xxlimited.c @@ -67,8 +67,8 @@ #endif #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include "Python.h" diff --git a/PC/winsound.c b/PC/winsound.c index 36e4d07..d1ff991 100644 --- a/PC/winsound.c +++ b/PC/winsound.c @@ -36,8 +36,8 @@ */ #ifndef Py_NOGIL -// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED -#define Py_LIMITED_API 0x030d0000 +// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030c0000 #endif #include -- cgit v0.12