Skip to content

Commit 2ac0515

Browse files
authored
bpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135)
xxlimited targets Python 3.10, not Python 3.16: fix the hexadecimal version number used in the Py_LIMITED_API macro.
1 parent 61092a9 commit 2ac0515

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Include/methodobject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
7979

8080
#define METH_COEXIST 0x0040
8181

82-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03100000
83-
#define METH_FASTCALL 0x0080
82+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
83+
# define METH_FASTCALL 0x0080
8484
#endif
8585

8686
/* This bit is preserved for Stackless Python */
8787
#ifdef STACKLESS
88-
#define METH_STACKLESS 0x0100
88+
# define METH_STACKLESS 0x0100
8989
#else
90-
#define METH_STACKLESS 0x0000
90+
# define METH_STACKLESS 0x0000
9191
#endif
9292

9393
/* METH_METHOD means the function stores an

PCbuild/xxlimited.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</PropertyGroup>
9595
<ItemDefinitionGroup>
9696
<ClCompile>
97-
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03100000</PreprocessorDefinitions>
97+
<PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x030A0000</PreprocessorDefinitions>
9898
</ClCompile>
9999
<Link>
100100
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ def detect_modules(self):
18671867
if 'd' not in sysconfig.get_config_var('ABIFLAGS'):
18681868
# Non-debug mode: Build xxlimited with limited API
18691869
self.add(Extension('xxlimited', ['xxlimited.c'],
1870-
define_macros=[('Py_LIMITED_API', '0x03100000')]))
1870+
define_macros=[('Py_LIMITED_API', '0x030a0000')]))
18711871
self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
18721872
define_macros=[('Py_LIMITED_API', '0x03050000')]))
18731873
else:

0 commit comments

Comments
 (0)