Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions Modules/_testlimitedcapi/heaptype_relative.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions Modules/_testlimitedcapi/parts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions Modules/_testlimitedcapi/vectorcall_limited.c
Original file line number Diff line number Diff line change
@@ -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"

Expand Down