File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * standard Python regression test, via Lib/test/test_capi.py.
66 */
77
8+ #include "pyconfig.h" // Py_GIL_DISABLED
9+
10+ #ifdef Py_GIL_DISABLED
11+ // Cannot test the limited C API
12+ #else
13+ // Use the oldest limited C API version
14+ # define Py_LIMITED_API 0x03020000
15+ #endif
16+
817#include "_testlimitedcapi/parts.h"
918
1019static PyMethodDef TestMethods [] = {
Original file line number Diff line number Diff line change 11#include "parts.h"
22
3+ #include <stdlib.h> // free()
4+
5+
36static void
47capsule_destructor (PyObject * op )
58{
Original file line number Diff line number Diff line change 11#include "pyconfig.h" // Py_GIL_DISABLED
2-
3- // Need limited C API version 3.5 for PyCodec_NameReplaceErrors()
4- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
5+ // Need limited C API version 3.5 for PyCodec_NameReplaceErrors()
56# define Py_LIMITED_API 0x03050000
67#endif
78
Original file line number Diff line number Diff line change 11#include "pyconfig.h" // Py_GIL_DISABLED
2- #ifndef Py_GIL_DISABLED
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
35 // Need limited C API 3.13 for PyLong_AsInt()
46# define Py_LIMITED_API 0x030d0000
57#endif
Original file line number Diff line number Diff line change 1- // Need limited C API version 3.15 for _DuringGC functions
21#include "pyconfig.h" // Py_GIL_DISABLED
3- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
2+ #ifdef Py_GIL_DISABLED
3+ // Cannot test the limited C API
4+ #else
5+ // Need limited C API version 3.15 for _DuringGC functions
46# define Py_LIMITED_API 0x030f0000
57#endif
68
Original file line number Diff line number Diff line change 1- // Need limited C API version 3.13 for PyImport_AddModuleRef()
21#include "pyconfig.h" // Py_GIL_DISABLED
3- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
5+ // Need limited C API version 3.13 for PyImport_AddModuleRef()
46# define Py_LIMITED_API 0x030d0000
57#endif
68
Original file line number Diff line number Diff line change 1- // Need limited C API version 3.13 for PyList_GetItemRef()
21#include "pyconfig.h" // Py_GIL_DISABLED
3- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
5+ // Need limited C API version 3.13 for PyList_GetItemRef()
46# define Py_LIMITED_API 0x030d0000
57#endif
68
Original file line number Diff line number Diff line change 11#include "pyconfig.h" // Py_GIL_DISABLED
2- #ifndef Py_GIL_DISABLED
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
35 // Need limited C API 3.14 to test PyLong_AsInt64()
46# define Py_LIMITED_API 0x030e0000
57#endif
Original file line number Diff line number Diff line change 1- // Need limited C API version 3.13 for Py_GetConstant()
21#include "pyconfig.h" // Py_GIL_DISABLED
3- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
2+ #ifdef Py_GIL_DISABLED
3+ # define Py_TARGET_ABI3T 0x030f0000
4+ #else
5+ // Need limited C API version 3.13 for Py_GetConstant()
46# define Py_LIMITED_API 0x030d0000
57#endif
68
Original file line number Diff line number Diff line change 77#include "pyconfig.h" // Py_GIL_DISABLED
88
99// Use the limited C API
10- #if !defined(Py_GIL_DISABLED ) && !defined(Py_LIMITED_API )
11- // need limited C API version 3.5 for PyModule_AddFunctions()
10+ #ifdef Py_GIL_DISABLED
11+ // Cannot test the limited C API
12+ #elif !defined(Py_LIMITED_API )
13+ // Need limited C API version 3.5 for PyModule_AddFunctions()
1214# define Py_LIMITED_API 0x03050000
1315#endif
1416
You can’t perform that action at this time.
0 commit comments