10000 bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151) · python/cpython@240bcf8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 240bcf8

Browse files
vstinnershihai1991
andauthored
bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151)
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>
1 parent 9bb5658 commit 240bcf8

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

Modules/xxlimited.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
pass
5656
*/
5757

58+
#define Py_LIMITED_API 0x030a0000
59+
5860
#include "Python.h"
5961

6062
// Module state

Modules/xxlimited_35.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
* See the xxlimited module for an extension module template.
66
*/
77

8-
/* Xxo objects */
8+
#define Py_LIMITED_API 0x03050000
99

1010
#include "Python.h"
1111

12+
/* Xxo objects */
13+
1214
static PyObject *ErrorObject;
1315

1416
typedef struct {

PCbuild/xxlimited.vcxproj

< 10000 span class="sr-only">Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@
9393
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
9494
</PropertyGroup>
9595
<ItemDefinitionGroup>
96-
<ClCompile>
97-
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x030A0000</PreprocessorDefinitions>
98-
</ClCompile>
9996
<Link>
10097
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
10198
</Link>

PCbuild/xxlimited_35.vcxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@
9393
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
9494
</PropertyGroup>
9595
<ItemDefinitionGroup>
96-
<ClCompile>
97-
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03060000</PreprocessorDefinitions>
98-
</ClCompile>
9996
<Link>
10097
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
10198
</Link>

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,10 +1865,8 @@ def detect_modules(self):
18651865
## self.add(Extension('xx', ['xxmodule.c']))
18661866

18671867
# Limited C API
1868-
self.add(Extension('xxlimited', ['xxlimited.c'],
1869-
define_macros=[('Py_LIMITED_API', '0x030a0000')]))
1870-
self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
1871-
define_macros=[('Py_LIMITED_API', '0x03050000')]))
1868+
self.add(Extension('xxlimited', ['xxlimited.c']))
1869+
self.add(Extension('xxlimited_35', ['xxlimited_35.c']))
18721870

18731871
def detect_tkinter_fromenv(self):
18741872
# Build _tkinter using the Tcl/Tk locations specified by

0 commit comments

Comments
 (0)
0