Skip to content

Commit 2ad80d8

Browse files
committed
Comments
1 parent 7835449 commit 2ad80d8

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

Include/pyabi.h

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
/* Defines to build Python and its standard library:
1616
*
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.
1919
* - Py_BUILD_CORE_BUILTIN: Build a Python stdlib module as a built-in module.
2020
* - Py_BUILD_CORE_MODULE: Build a Python stdlib module as a dynamic library.
2121
*
@@ -32,17 +32,17 @@
3232
#endif
3333

3434
/* 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.)
4646
*/
4747
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) \
4848
&& !defined(Py_TARGET_ABI3T)
@@ -62,26 +62,27 @@
6262

6363
#if defined(Py_TARGET_ABI3T)
6464
# 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.
6767
# define Py_GIL_DISABLED
6868
# endif
6969
# 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.
7575
# ifdef __GNUC__
7676
# undef Py_GIL_DISABLED
7777
# pragma GCC poison Py_GIL_DISABLED
7878
# endif
7979
# endif
8080
#endif
8181

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+
*/
8586
#ifdef Py_BUILD_CORE
8687
# define _PyEXPORTS_CORE
8788
#endif

0 commit comments

Comments
 (0)