|
14 | 14 |
|
15 | 15 | /* Defines to build Python and its standard library: |
16 | 16 | * |
17 | | - * - Py_BUILD_CORE: Build Python core. Give access to Python internals, but |
18 | | - * should not be used by third-party modules. |
| 17 | + * - Py_BUILD_CORE: Build Python core. Gives access to Python internals; should |
| 18 | + * not be used by third-party modules. |
19 | 19 | * - Py_BUILD_CORE_BUILTIN: Build a Python stdlib module as a built-in module. |
20 | 20 | * - Py_BUILD_CORE_MODULE: Build a Python stdlib module as a dynamic library. |
21 | 21 | * |
|
32 | 32 | #endif |
33 | 33 |
|
34 | 34 | /* Stable ABI for free-threaded builds (abi3t, introduced in PEP 803) |
35 | | - is enabled by the user setting one of: |
36 | | - - Py_TARGET_ABI3T, or |
37 | | - - Py_LIMITED_API and Py_GIL_DISABLED. |
38 | | -
|
39 | | - These affect set the following, which Python.h should use internally: |
40 | | - - Py_LIMITED_API (defines the subset of API we expose) |
41 | | - - _Py_OPAQUE_PYOBJECT (additionally hides what's ABI-incompatible between |
42 | | - free-threaded & GIL) |
43 | | -
|
44 | | - (Don't use Py_TARGET_ABI3T directly. It's currently only used to set these |
45 | | - 2 macros, and defined for users' convenience.) |
| 35 | + * is enabled by one of: |
| 36 | + * - Py_TARGET_ABI3T, or |
| 37 | + * - Py_LIMITED_API and Py_GIL_DISABLED. |
| 38 | + * |
| 39 | + * These affect set the following, which Python.h should use internally: |
| 40 | + * - Py_LIMITED_API (defines the subset of API we expose) |
| 41 | + * - _Py_OPAQUE_PYOBJECT (additionally hides what's ABI-incompatible between |
| 42 | + * free-threaded & GIL) |
| 43 | + * |
| 44 | + * (Don't use Py_TARGET_ABI3T directly. It's currently only used to set these |
| 45 | + * 2 macros, and defined for users' convenience.) |
46 | 46 | */ |
47 | 47 | #if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) \ |
48 | 48 | && !defined(Py_TARGET_ABI3T) |
|
62 | 62 |
|
63 | 63 | #if defined(Py_TARGET_ABI3T) |
64 | 64 | # if !defined(Py_GIL_DISABLED) |
65 | | -// Define Py_GIL_DISABLED for users' needs. Users check this macro to see |
66 | | -// whether they need extra synchronization. |
| 65 | + // Define Py_GIL_DISABLED for users' needs. Users check this macro to see |
| 66 | + // whether they need extra synchronization. |
67 | 67 | # define Py_GIL_DISABLED |
68 | 68 | # endif |
69 | 69 | # if defined(_Py_IS_TESTCEXT) |
70 | | -// When compiling for abi3t, contents of Python.h should not depend |
71 | | -// on Py_GIL_DISABLED. |
72 | | -// We ask GCC to error if it sees the macro from this point on. |
73 | | -// Since users are free to the macro, and there's no way to undo the poisoning |
74 | | -// at the end of Python.h, we only do this in a test module. |
| 70 | + // When compiling for abi3t, contents of Python.h should not depend |
| 71 | + // on Py_GIL_DISABLED. |
| 72 | + // We ask GCC to error if it sees the macro from this point on. |
| 73 | + // Since users are free to the macro, and there's no way to undo the |
| 74 | + // poisoning at the end of Python.h, we only do this in a test module. |
75 | 75 | # ifdef __GNUC__ |
76 | 76 | # undef Py_GIL_DISABLED |
77 | 77 | # pragma GCC poison Py_GIL_DISABLED |
78 | 78 | # endif |
79 | 79 | # endif |
80 | 80 | #endif |
81 | 81 |
|
82 | | -// The internal C API must not be used with the limited C API: make sure |
83 | | -// that Py_BUILD_CORE* macros are not defined in this case. |
84 | | -// But, keep the "original" values, under different names, for "exports.h" |
| 82 | +/* The internal C API must not be used with the limited C API: make sure |
| 83 | + * that Py_BUILD_CORE* macros are not defined in this case. |
| 84 | + * But, keep the "original" values, under different names, for "exports.h" |
| 85 | + */ |
85 | 86 | #ifdef Py_BUILD_CORE |
86 | 87 | # define _PyEXPORTS_CORE |
87 | 88 | #endif |
|
0 commit comments