File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 4747#endif
4848
4949#if defined(Py_GIL_DISABLED )
50- # if defined(Py_LIMITED_API ) && !defined(_Py_OPAQUE_PYOBJECT )
51- # error "Py_LIMITED_API is not currently supported in the free-threaded build"
52- # endif
53-
5450# if defined(_MSC_VER )
5551# include <intrin.h> // __readgsqword()
5652# endif
Original file line number Diff line number Diff line change 6161#define PYTHON_ABI_VERSION 3
6262#define PYTHON_ABI_STRING "3"
6363
64+
65+ /* Stable ABI for free-threaded builds (introduced in PEP 803)
66+ is enabled by one of:
67+ - Py_TARGET_ABI3T, or
68+ - Py_LIMITED_API and Py_GIL_DISABLED.
69+ "Output" macros to be used internally:
70+ - Py_LIMITED_API (defines the subset of API we expose)
71+ - _Py_OPAQUE_PYOBJECT (additionally hides what's ABI-incompatible between
72+ free-threaded & GIL)
73+ (Don't use Py_TARGET_ABI3T directly; we merge into the above two here.
74+ We do set it for users' convenience though.)
75+ */
76+ #if defined(Py_LIMITED_API ) && defined(Py_GIL_DISABLED ) \
77+ && !defined(Py_TARGET_ABI3T )
78+ # define Py_TARGET_ABI3T Py_LIMITED_API
79+ #endif
80+ #if defined(Py_TARGET_ABI3T )
81+ # define _Py_OPAQUE_PYOBJECT
82+ # if !defined(Py_LIMITED_API )
83+ # define Py_LIMITED_API Py_TARGET_ABI3T
84+ # elif Py_LIMITED_API > Py_TARGET_ABI3T
85+ // if both are defined, use the *lower* version,
86+ // i.e. maximum compatibility
87+ # undef Py_LIMITED_API
88+ # define Py_LIMITED_API Py_TARGET_ABI3T
89+ # endif
90+ #endif
91+
6492#endif //_Py_PATCHLEVEL_H
You can’t perform that action at this time.
0 commit comments