gh-116417: Build _testinternalcapi with limited C API version 3.5 (#116598)

This commit is contained in:
Victor Stinner 2024-03-11 15:20:04 +01:00 committed by GitHub
parent b6ae6da1bd
commit 546eb7a3be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 2 deletions

View 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

View 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.

View 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"