File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828#if !defined(_CFFI_USE_EMBEDDING ) && !defined(Py_LIMITED_API )
2929# ifdef _MSC_VER
3030# if !defined(_DEBUG ) && !defined(Py_DEBUG ) && !defined(Py_TRACE_REFS ) && !defined(Py_REF_DEBUG ) && !defined(_CFFI_NO_LIMITED_API )
31- # define Py_LIMITED_API
31+ # if !defined(Py_GIL_DISABLED )
32+ # define Py_LIMITED_API
33+ # else
34+ # define Py_LIMITED_API 0x030f0000
35+ # endif
3236# endif
37+
3338# include <pyconfig.h>
3439 /* sanity-check: Py_LIMITED_API will cause crashes if any of these
3540 are also defined. Normally, the Python file PC/pyconfig.h does not
4954# else
5055# include <pyconfig.h>
5156# if !defined(Py_DEBUG ) && !defined(Py_TRACE_REFS ) && !defined(Py_REF_DEBUG ) && !defined(_CFFI_NO_LIMITED_API )
52- # define Py_LIMITED_API
57+ # if !defined(Py_GIL_DISABLED )
58+ # define Py_LIMITED_API
59+ # else
60+ # define Py_LIMITED_API 0x030f0000
61+ # endif
5362# endif
5463# endif
5564#endif
Original file line number Diff line number Diff line change @@ -110,8 +110,7 @@ def _set_py_limited_api(Extension, kwds):
110110 log .info ("Ignoring py_limited_api=True for free-threaded build." )
111111 kwds ['py_limited_api' ] = False
112112 else :
113- kwds .setdefault ("define_macros" , []).append (("_Py_OPAQUE_PYOBJECT" , None ))
114- kwds ["define_macros" ].append (("Py_LIMITED_API" , "0x030f0000" ))
113+ kwds ["define_macros" ].append (("Py_TARGET_ABI3T" , "0x030f0000" ))
115114
116115 if kwds .get ('py_limited_api' ) is False :
117116 # avoid setting Py_LIMITED_API if py_limited_api=False
You can’t perform that action at this time.
0 commit comments