]> Savannah Git Hosting - gnulib.git/commitdiff
math: Fix INFINITY and NAN on mingw.
authorBruno Haible <bruno@clisp.org>
Thu, 8 Aug 2024 01:21:34 +0000 (03:21 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 8 Aug 2024 01:21:34 +0000 (03:21 +0200)
* doc/posix-headers/math.texi: Mention this mingw bug.
* lib/math.in.h (INFINITY, NAN): Replace also on mingw.

ChangeLog
doc/posix-headers/math.texi
lib/math.in.h

index 380874aa2daf0370f10c9a2913fe97b6421cfbda..1eb55af7702fe265ef8b76f7a72604cfeb135474 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-07  Bruno Haible  <bruno@clisp.org>
+
+       math: Fix INFINITY and NAN on mingw.
+       * doc/posix-headers/math.texi: Mention this mingw bug.
+       * lib/math.in.h (INFINITY, NAN): Replace also on mingw.
+
 2024-08-07  Bruno Haible  <bruno@clisp.org>
 
        doc: Update for OpenBSD 7.5.
index 6f07b1e58c6616511d44d3182cc5301fdc93b1f9..fb72b94a08c21cbaa0608d50b9e5f16caa69e8e2 100644 (file)
@@ -55,7 +55,7 @@ FreeBSD 5.2, AIX 7.1.
 @item
 @code{INFINITY} and @code{NAN} are of type @code{double} instead of @code{float}
 on some platforms:
-FreeBSD 7.1.
+FreeBSD 7.1, mingw 5.0.
 
 @item
 The macros @code{NAN}, @code{HUGE_VALL}, and @code{INFINITY} are not
index 7b1302d8831614ed3f36c70f3a26db766ab9b9fc..2fcba31c763c1faa075c6de5db473e16ec81c38c 100644 (file)
@@ -161,7 +161,7 @@ static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
 
 
 /* Ensure that INFINITY is a constant expression, of type 'float'.  */
-#if !defined INFINITY || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined _AIX
+#if !defined INFINITY || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined _AIX || defined __MINGW32__
 # undef INFINITY
 # if defined __GNUC__ || defined __clang__
 #  define INFINITY (__builtin_inff ())
@@ -176,7 +176,7 @@ static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
    it on platforms like Solaris 10, where NAN is present but defined
    as a function pointer rather than a floating point constant.
    Also ensure that it is a constant expression, of type 'float'.  */
-#if !defined NAN || @REPLACE_NAN@ || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined _AIX
+#if !defined NAN || @REPLACE_NAN@ || (defined __FreeBSD__ && __FreeBSD__ < 8) || defined _AIX || defined __MINGW32__
 # if !GNULIB_defined_NAN
 #  undef NAN
   /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler