]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116417: Build _testinternalcapi with limited C API version 3.5 (#116598)
authorVictor Stinner <vstinner@python.org>
Mon, 11 Mar 2024 14:20:04 +0000 (15:20 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 14:20:04 +0000 (15:20 +0100)
Modules/_testlimitedcapi/heaptype_relative.c
Modules/_testlimitedcapi/parts.h
Modules/_testlimitedcapi/vectorcall_limited.c

index 9878a4daf1b2cbe40d8435276f71bee4f71fe45d..d0316dd4fc63b4b4ab9e831639217b2d2bc81350 100644 (file)
@@ -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
index 039576d5cf4c29191cc80489e601c566075bd765..9bc52413382eb577ee82cb4a877e59f45ed05776 100644 (file)
@@ -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.
index 24aa5e991eca3fe0e30bca98a2918179dcb1748a..fc1a89c9098e1b34f812a9f4275e68b1bdf51a4f 100644 (file)
@@ -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"