]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135)
authorVictor Stinner <vstinner@python.org>
Thu, 1 Apr 2021 13:09:33 +0000 (15:09 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Apr 2021 13:09:33 +0000 (15:09 +0200)
xxlimited targets Python 3.10, not Python 3.16: fix the hexadecimal
version number used in the Py_LIMITED_API macro.

Include/methodobject.h
PCbuild/xxlimited.vcxproj
setup.py

index 7aa4e41ccca1fe1c59ed74227c53ec2556e907d2..9ffe8e1a3ddfcb6558efe61f52b5a52487c6f189 100644 (file)
@@ -79,15 +79,15 @@ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
 
 #define METH_COEXIST   0x0040
 
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03100000
-#define METH_FASTCALL  0x0080
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
+#  define METH_FASTCALL  0x0080
 #endif
 
 /* This bit is preserved for Stackless Python */
 #ifdef STACKLESS
-#define METH_STACKLESS 0x0100
+#  define METH_STACKLESS 0x0100
 #else
-#define METH_STACKLESS 0x0000
+#  define METH_STACKLESS 0x0000
 #endif
 
 /* METH_METHOD means the function stores an
index ece169127a28603e11a6cd86d39c6affbe5b61ea..61e4e5784e7abee852bf7fafedf5a43ec6730ed1 100644 (file)
@@ -94,7 +94,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03100000</PreprocessorDefinitions>
+      <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x030A0000</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
index e3fbd78bc08b84411aca0cc34973dae11a7b65f6..75bd16375063a0646512dd17aad642fa2af9e36a 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1867,7 +1867,7 @@ class PyBuildExt(build_ext):
         if 'd' not in sysconfig.get_config_var('ABIFLAGS'):
             # Non-debug mode: Build xxlimited with limited API
             self.add(Extension('xxlimited', ['xxlimited.c'],
-                               define_macros=[('Py_LIMITED_API', '0x03100000')]))
+                               define_macros=[('Py_LIMITED_API', '0x030a0000')]))
             self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
                                define_macros=[('Py_LIMITED_API', '0x03050000')]))
         else: