aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-03-11 15:20:04 +0100
committerGitHub <noreply@github.com>2024-03-11 15:20:04 +0100
commit546eb7a3be241c5abd8a83cebbbab8c71107edcf (patch)
treec5e743ce83166d800a3842d3331ae9fe79e4328e
parentGH-116596: Better determination of escaping uops. (GH-116597) (diff)
downloadcpython-546eb7a3be241c5abd8a83cebbbab8c71107edcf.tar.gz
cpython-546eb7a3be241c5abd8a83cebbbab8c71107edcf.tar.bz2
cpython-546eb7a3be241c5abd8a83cebbbab8c71107edcf.zip
gh-116417: Build _testinternalcapi with limited C API version 3.5 (#116598)
-rw-r--r--Modules/_testlimitedcapi/heaptype_relative.c6
-rw-r--r--Modules/_testlimitedcapi/parts.h5
-rw-r--r--Modules/_testlimitedcapi/vectorcall_limited.c6
3 files changed, 15 insertions, 2 deletions
diff --git a/Modules/_testlimitedcapi/heaptype_relative.c b/Modules/_testlimitedcapi/heaptype_relative.c
index 9878a4daf1b..d0316dd4fc6 100644
--- a/Modules/_testlimitedcapi/heaptype_relative.c
+++ b/Modules/_testlimitedcapi/heaptype_relative.c
@@ -1,3 +1,9 @@
+// Need limited C API version 3.12 for PyType_FromMetaclass()
+#include "pyconfig.h" // Py_GIL_DISABLED
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
+# define Py_LIMITED_API 0x030c0000
+#endif
+
#include "parts.h"
#include <stddef.h> // max_align_t
#include <string.h> // memset
diff --git a/Modules/_testlimitedcapi/parts.h b/Modules/_testlimitedcapi/parts.h
index 039576d5cf4..9bc52413382 100644
--- a/Modules/_testlimitedcapi/parts.h
+++ b/Modules/_testlimitedcapi/parts.h
@@ -7,8 +7,9 @@
#include "pyconfig.h" // Py_GIL_DISABLED
// Use the limited C API
-#ifndef Py_GIL_DISABLED
-# define Py_LIMITED_API 0x030c0000 // 3.12
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
+ // need limited C API version 3.5 for PyModule_AddFunctions()
+# define Py_LIMITED_API 0x03050000
#endif
// Make sure that the internal C API cannot be used.
diff --git a/Modules/_testlimitedcapi/vectorcall_limited.c b/Modules/_testlimitedcapi/vectorcall_limited.c
index 24aa5e991ec..fc1a89c9098 100644
--- a/Modules/_testlimitedcapi/vectorcall_limited.c
+++ b/Modules/_testlimitedcapi/vectorcall_limited.c
@@ -1,5 +1,11 @@
/* Test Vectorcall in the limited API */
+// Need limited C API version 3.12 for PyObject_Vectorcall()
+#include "pyconfig.h" // Py_GIL_DISABLED
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
+# define Py_LIMITED_API 0x030c0000
+#endif
+
#include "parts.h"
#include "clinic/vectorcall_limited.c.h"