]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108765: Python.h no longer includes <ieeefp.h> (#108781)
authorVictor Stinner <vstinner@python.org>
Sat, 2 Sep 2023 13:48:32 +0000 (15:48 +0200)
committerGitHub <noreply@github.com>
Sat, 2 Sep 2023 13:48:32 +0000 (15:48 +0200)
Remove also the HAVE_IEEEFP_H macro: remove ieeefp.h from the
AC_CHECK_HEADERS() check of configure.ac.

Doc/whatsnew/3.13.rst
Include/Python.h
Include/pyport.h
Misc/NEWS.d/next/C API/2023-09-01-20-41-49.gh-issue-108765.5dXc1r.rst [new file with mode: 0644]
configure
configure.ac
pyconfig.h.in

index d35d20ebb252936f6cf2a296e4312f81e50416b1..e7b60ddbdbbfda40d8eeb9765e5d163eb3dd522e 100644 (file)
@@ -915,6 +915,12 @@ New Features
 Porting to Python 3.13
 ----------------------
 
+* ``Python.h`` no longer includes the ``<ieeefp.h>`` standard header. It was
+  included for the ``finite()`` function which is now provided by the
+  ``<math.h>`` header. It should now be included explicitly if needed. Remove
+  also the ``HAVE_IEEEFP_H`` macro.
+  (Contributed by Victor Stinner in :gh:`108765`.)
+
 Deprecated
 ----------
 
index 44f0fd3ee4b56b5361e9f2faabef2b3e9625a48a..002a79dbdc93629d46d20311b6e164ce51f87372 100644 (file)
@@ -20,6 +20,7 @@
 #include <ctype.h>                // tolower()
 #include <inttypes.h>             // uintptr_t
 #include <limits.h>               // INT_MAX
+#include <math.h>                 // HUGE_VAL
 #include <stdarg.h>               // va_list
 #include <wchar.h>                // wchar_t
 #ifdef HAVE_STDDEF_H
index 67164328d2957662217600c8b472497494493567..f2046de2bbcc5a05085cc94c900e896c0c00f072 100644 (file)
@@ -184,12 +184,6 @@ typedef Py_ssize_t Py_ssize_clean_t;
 #  define Py_MEMCPY memcpy
 #endif
 
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>  /* needed for 'finite' declaration on some platforms */
-#endif
-
-#include <math.h> /* Moved here from the math section, before extern "C" */
-
 /********************************************
  * WRAPPER FOR <time.h> and/or <sys/time.h> *
  ********************************************/
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 (file)
index 0000000..cc512df
--- /dev/null
@@ -0,0 +1,4 @@
+``Python.h`` no longer includes the ``<ieeefp.h>`` standard header. It was
+included for the ``finite()`` function which is now provided by the
+``<math.h>`` header. It should now be included explicitly if needed. Remove
+also the ``HAVE_IEEEFP_H`` macro. Patch by Victor Stinner.
index 983b1edf4a86e12ed14c26f7ed29488567525928..d73b4b271ac7199daaf7d2d02dc0ed36ceb60816 100755 (executable)
--- 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
index 10f132faa9d80d2949d666de31a46476d7865090..612c072af329d46615e4f672220efce009183cd3 100644 (file)
@@ -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 \
index 418ccade8e8bb15366530c3b0fb59565de6122da..86c72cc6b4e62a56c72208f9ded25eb894c2d22a 100644 (file)
 /* Define this if you have le64toh() */
 #undef HAVE_HTOLE64
 
-/* Define to 1 if you have the <ieeefp.h> header file. */
-#undef HAVE_IEEEFP_H
-
 /* Define to 1 if you have the `if_nameindex' function. */
 #undef HAVE_IF_NAMEINDEX