From: Victor Stinner Date: Fri, 27 Oct 2023 20:56:12 +0000 (+0200) Subject: gh-108765: Include explicitly in signalmodule.c (#111402) X-Git-Tag: v3.13.0a2~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77bb0d5f5047223e5d8f855ee21442ea9505834e;p=thirdparty%2FPython%2Fcpython.git gh-108765: Include explicitly in signalmodule.c (#111402) unistd.h is needed by alarm() and pause() functions. --- diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 34dd3ea8858e..84d5daae6e62 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1120,7 +1120,8 @@ Porting to Python 3.13 * ``Python.h`` no longer includes the ```` standard header file. If needed, it should now be included explicitly. For example, it provides the functions: ``read()``, ``write()``, ``close()``, ``isatty()``, ``lseek()``, - ``getpid()``, ``getcwd()``, ``sysconf()`` and ``getpagesize()``. + ``getpid()``, ``getcwd()``, ``sysconf()``, ``getpagesize()``, ``alarm()`` and + ``pause()``. 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 ```` and diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 2932d94858af..f3ba0915760f 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -21,6 +21,9 @@ # include "socketmodule.h" // SOCKET_T #endif +#ifdef HAVE_UNISTD_H +# include // alarm() +#endif #ifdef MS_WINDOWS # ifdef HAVE_PROCESS_H # include