Skip to content

Commit 546eb7a

Browse files
authored
gh-116417: Build _testinternalcapi with limited C API version 3.5 (#116598)
1 parent b6ae6da commit 546eb7a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Modules/_testlimitedcapi/heaptype_relative.c

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Need limited C API version 3.12 for PyType_FromMetaclass()
2+
#include "pyconfig.h" // Py_GIL_DISABLED
3+
#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
4+
# define Py_LIMITED_API 0x030c0000
5+
#endif
6+
17
#include "parts.h"
28
#include <stddef.h> // max_align_t
39
#include <string.h> // memset

Modules/_testlimitedcapi/parts.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
#include "pyconfig.h" // Py_GIL_DISABLED
88

99
// Use the limited C API
10-
#ifndef Py_GIL_DISABLED
11-
# define Py_LIMITED_API 0x030c0000 // 3.12
10+
#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
11+
// need limited C API version 3.5 for PyModule_AddFunctions()
12+
# define Py_LIMITED_API 0x03050000
1213
#endif
1314

1415
// Make sure that the internal C API cannot be used.

Modules/_testlimitedcapi/vectorcall_limited.c

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/* Test Vectorcall in the limited API */
22

3+
// Need limited C API version 3.12 for PyObject_Vectorcall()
4+
#include "pyconfig.h" // Py_GIL_DISABLED
5+
#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
6+
# define Py_LIMITED_API 0x030c0000
7+
#endif
8+
39
#include "parts.h"
410
#include "clinic/vectorcall_limited.c.h"
511

0 commit comments

Comments
 (0)