]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151)
authorVictor Stinner <vstinner@python.org>
Fri, 2 Apr 2021 14:48:11 +0000 (16:48 +0200)
committerGitHub <noreply@github.com>
Fri, 2 Apr 2021 14:48:11 +0000 (16:48 +0200)
xxlimited.c and xxlimited_35.c now define the Py_LIMITED_API macro,
rather than having to do it in the build recipe.

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Modules/xxlimited.c
Modules/xxlimited_35.c
PCbuild/xxlimited.vcxproj
PCbuild/xxlimited_35.vcxproj
setup.py

index 883c8a9b5e1833c851ca29b813580caff694b1db..c3d98d34eb5915f5bbe7f4e8019b25c8ff8cb71e 100644 (file)
@@ -55,6 +55,8 @@
           pass
    */
 
+#define Py_LIMITED_API 0x030a0000
+
 #include "Python.h"
 
 // Module state
index ce96e8c90efd4727113d578c970a274dc13195fb..5e93854f68571be9c19879debc8e624bd62f4f81 100644 (file)
@@ -5,10 +5,12 @@
  * See the xxlimited module for an extension module template.
  */
 
-/* Xxo objects */
+#define Py_LIMITED_API 0x03050000
 
 #include "Python.h"
 
+/* Xxo objects */
+
 static PyObject *ErrorObject;
 
 typedef struct {
index 61e4e5784e7abee852bf7fafedf5a43ec6730ed1..1c776fb0da3e72ab0854663035dee70dabe34188 100644 (file)
@@ -93,9 +93,6 @@
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
   </PropertyGroup>
   <ItemDefinitionGroup>
-    <ClCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x030A0000</PreprocessorDefinitions>
-    </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
index 7e49eadf9037da474bc29c26d9c1f18823c07b35..dd830b3b6aaa91c3c72b6b129d3c6031ae10baff 100644 (file)
@@ -93,9 +93,6 @@
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
   </PropertyGroup>
   <ItemDefinitionGroup>
-    <ClCompile>
-      <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03060000</PreprocessorDefinitions>
-    </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
index 3b4e7ae70a4ec4f845cf5950108134b836697ca3..edf3cb4f230b57080fee370f3113f7f41d404e73 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1865,10 +1865,8 @@ class PyBuildExt(build_ext):
 ##         self.add(Extension('xx', ['xxmodule.c']))
 
         # Limited C API
-        self.add(Extension('xxlimited', ['xxlimited.c'],
-                           define_macros=[('Py_LIMITED_API', '0x030a0000')]))
-        self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
-                           define_macros=[('Py_LIMITED_API', '0x03050000')]))
+        self.add(Extension('xxlimited', ['xxlimited.c']))
+        self.add(Extension('xxlimited_35', ['xxlimited_35.c']))
 
     def detect_tkinter_fromenv(self):
         # Build _tkinter using the Tcl/Tk locations specified by