]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-114329: Fix PyList_GetItemRef() limited C API definition (#117520)
authorVictor Stinner <vstinner@python.org>
Wed, 3 Apr 2024 21:02:42 +0000 (23:02 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Apr 2024 21:02:42 +0000 (21:02 +0000)
Include/listobject.h
Modules/_testlimitedcapi/heaptype_relative.c
Modules/_testlimitedcapi/list.c
Modules/_testlimitedcapi/object.c
Modules/_testlimitedcapi/parts.h
Modules/_testlimitedcapi/vectorcall_limited.c

index 4e4084b43483a2deec573e79e876dd1699173b5e..e1e059b0ba7466c4a6d6fd54e5fe70bd99f4e8c5 100644 (file)
@@ -29,7 +29,9 @@ PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
 PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
 
 PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
 PyAPI_FUNC(PyObject *) PyList_GetItemRef(PyObject *, Py_ssize_t);
+#endif
 PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
 PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
 PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
index 7c508c6182bc8a8f97ebc3919ae167592883c0e0..c2531518d86a5107d0bad01d6eb71243a198f1f6 100644 (file)
@@ -1,6 +1,6 @@
 // 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 )
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
 #  define Py_LIMITED_API 0x030c0000
 #endif
 
index 3022cbf9191b2e9cdb8432bfb2b18c5104b4765d..ed492c3e719727ad17026e3e4171e6922093bbe6 100644 (file)
@@ -1,3 +1,9 @@
+// Need limited C API version 3.13 for PyList_GetItemRef()
+#include "pyconfig.h"   // Py_GIL_DISABLED
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
+#  define Py_LIMITED_API 0x030d0000
+#endif
+
 #include "parts.h"
 #include "util.h"
 
index 6e438c811d6e9827a26e946913de55c806c9e452..da6fe3e4efa34c221d928cadc8b8768e27759648 100644 (file)
@@ -1,6 +1,6 @@
 // Need limited C API version 3.13 for Py_GetConstant()
 #include "pyconfig.h"   // Py_GIL_DISABLED
-#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
 #  define Py_LIMITED_API 0x030d0000
 #endif
 
index d91f174cd31eedc4c14af1913a642f7cca8aa3e3..d5e590a8dcd679d118ba07508de43d39ac04869e 100644 (file)
@@ -7,7 +7,7 @@
 #include "pyconfig.h"   // Py_GIL_DISABLED
 
 // Use the limited C API
-#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
+#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
index 784126c17fccc1e40012aca1e96227151cbac673..5ef97ca8a063e1d3ec0d2cf047276a7a542983de 100644 (file)
@@ -2,7 +2,7 @@
 
 // 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 )
+#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
 #  define Py_LIMITED_API 0x030c0000
 #endif