diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-30 17:25:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 17:25:54 (GMT) |
commit | 74e425ec186dde6bcfb172616fe8f35ccb5a09bb (patch) | |
tree | 2c9167ef4bc17e11d2ada574f184949a8f53e5bc /Doc | |
parent | f3bb00ea12db6525f07d62368a65efec47d192b9 (diff) | |
download | cpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.zip cpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.tar.gz cpython-74e425ec186dde6bcfb172616fe8f35ccb5a09bb.tar.bz2 |
gh-110014: Fix _POSIX_THREADS and _POSIX_SEMAPHORES usage (#110139)
* pycore_pythread.h is now the central place to make sure that
_POSIX_THREADS and _POSIX_SEMAPHORES macros are defined if
available.
* Make sure that pycore_pythread.h is included when _POSIX_THREADS
and _POSIX_SEMAPHORES macros are tested.
* PY_TIMEOUT_MAX is now defined as a constant, since its value
depends on _POSIX_THREADS, instead of being defined as a macro.
* Prevent integer overflow in the preprocessor when computing
PY_TIMEOUT_MAX_VALUE on Windows:
replace "0xFFFFFFFELL * 1000 < LLONG_MAX"
with "0xFFFFFFFELL < LLONG_MAX / 1000".
* Document the change and give hints how to fix affected code.
* Add an exception for PY_TIMEOUT_MAX name to smelly.py
* Add PY_TIMEOUT_MAX to the stable ABI
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/data/stable_abi.dat | 1 | ||||
-rw-r--r-- | Doc/whatsnew/3.13.rst | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index c189c78..07c6d51 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -1,4 +1,5 @@ role,name,added,ifdef_note,struct_abi_kind +var,PY_TIMEOUT_MAX,3.2,, macro,PY_VECTORCALL_ARGUMENTS_OFFSET,3.12,, function,PyAIter_Check,3.10,, function,PyArg_Parse,3.2,, diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index c9e6ca8..d6188e6 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -989,6 +989,10 @@ Porting to Python 3.13 * ``Python.h`` no longer includes the ``<unistd.h>`` standard header file. If needed, it should now be included explicitly. For example, it provides the functions: ``close()``, ``getpagesize()``, ``getpid()`` and ``sysconf()``. + As a consequence, ``_POSIX_SEMAPHORES`` and ``_POSIX_THREADS`` macros are no + longer defined by ``Python.h``. The ``HAVE_UNISTD_H`` and ``HAVE_PTHREAD_H`` + macros defined by ``Python.h`` can be used to decide if ``<unistd.h>`` and + ``<pthread.h>`` header files can be included. (Contributed by Victor Stinner in :gh:`108765`.) * ``Python.h`` no longer includes these standard header files: ``<time.h>``, |