From 4ba18099b70c9f20f69357bac94d74f7c3238d7f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 2 Sep 2023 15:48:32 +0200 Subject: [PATCH] gh-108765: Python.h no longer includes (#108781) Remove also the HAVE_IEEEFP_H macro: remove ieeefp.h from the AC_CHECK_HEADERS() check of configure.ac. --- Doc/whatsnew/3.13.rst | 6 ++++++ Include/Python.h | 1 + Include/pyport.h | 6 ------ .../C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst | 4 ++++ configure | 6 ------ configure.ac | 2 +- pyconfig.h.in | 3 --- 7 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 Misc/NEWS.d/next/C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index d35d20ebb25..e7b60ddbdbb 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -915,6 +915,12 @@ New Features Porting to Python 3.13 ---------------------- +* ``Python.h`` no longer includes the ```` standard header. It was + included for the ``finite()`` function which is now provided by the + ```` header. It should now be included explicitly if needed. Remove + also the ``HAVE_IEEEFP_H`` macro. + (Contributed by Victor Stinner in :gh:`108765`.) + Deprecated ---------- diff --git a/Include/Python.h b/Include/Python.h index 44f0fd3ee4b..002a79dbdc9 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -20,6 +20,7 @@ #include // tolower() #include // uintptr_t #include // INT_MAX +#include // HUGE_VAL #include // va_list #include // wchar_t #ifdef HAVE_STDDEF_H diff --git a/Include/pyport.h b/Include/pyport.h index 67164328d29..f2046de2bbc 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -184,12 +184,6 @@ typedef Py_ssize_t Py_ssize_clean_t; # define Py_MEMCPY memcpy #endif -#ifdef HAVE_IEEEFP_H -#include /* needed for 'finite' declaration on some platforms */ -#endif - -#include /* Moved here from the math section, before extern "C" */ - /******************************************** * WRAPPER FOR and/or * ********************************************/ diff --git a/Misc/NEWS.d/next/C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst b/Misc/NEWS.d/next/C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst new file mode 100644 index 00000000000..cc512df7e1b --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst @@ -0,0 +1,4 @@ +``Python.h`` no longer includes the ```` standard header. It was +included for the ``finite()`` function which is now provided by the +```` header. It should now be included explicitly if needed. Remove +also the ``HAVE_IEEEFP_H`` macro. Patch by Victor Stinner. diff --git a/configure b/configure index 983b1edf4a8..d73b4b271ac 100755 --- a/configure +++ b/configure @@ -10325,12 +10325,6 @@ if test "x$ac_cv_header_grp_h" = xyes then : printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" -if test "x$ac_cv_header_ieeefp_h" = xyes -then : - printf "%s\n" "#define HAVE_IEEEFP_H 1" >>confdefs.h - fi ac_fn_c_check_header_compile "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default" if test "x$ac_cv_header_io_h" = xyes diff --git a/configure.ac b/configure.ac index 10f132faa9d..612c072af32 100644 --- a/configure.ac +++ b/configure.ac @@ -2667,7 +2667,7 @@ AC_DEFINE([STDC_HEADERS], [1], # checks for header files AC_CHECK_HEADERS([ \ alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ + io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ diff --git a/pyconfig.h.in b/pyconfig.h.in index 418ccade8e8..86c72cc6b4e 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -607,9 +607,6 @@ /* Define this if you have le64toh() */ #undef HAVE_HTOLE64 -/* Define to 1 if you have the header file. */ -#undef HAVE_IEEEFP_H - /* Define to 1 if you have the `if_nameindex' function. */ #undef HAVE_IF_NAMEINDEX