]> Savannah Git Hosting - gnulib.git/commitdiff
math: Fix test failure on Haiku.
authorBruno Haible <bruno@clisp.org>
Sun, 29 Oct 2017 09:49:55 +0000 (10:49 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 29 Oct 2017 20:27:45 +0000 (21:27 +0100)
ChangeLog
doc/posix-headers/math.texi
lib/math.in.h
m4/ilogb.m4
m4/ilogbf.m4

index 3102b6b18b0cedddfe70fdc8ac677a134e5006cc..bae2722a61d2a1dfc52d863d395b5b986d17d7a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-29  Bruno Haible  <bruno@clisp.org>
+
+       math: Fix test failure on Haiku.
+       * lib/math.in.h (FP_ILOGB0, FP_ILOGBNAN): Override on Haiku.
+       * m4/ilogb.m4 (gl_FUNC_ILOGB_WORKS): Update accordingly.
+       * m4/ilogbf.m4 (gl_FUNC_ILOGBF_WORKS): Likewise.
+       * doc/posix-headers/math.texi: Mention the Haiku problem.
+
 2017-10-29  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.
index 0cf56a05fb017c1e01ad41884668b20db5af26e4..bc89238e7bead92264792f19018e675920512d87 100644 (file)
@@ -36,6 +36,11 @@ The macros @code{FP_ILOGB0} and @code{FP_ILOGBNAN} are not defined on some
 platforms:
 NetBSD 5.1, AIX 5.1, IRIX 6.5, Solaris 9, MSVC 9.
 
+@item
+The macros @code{FP_ILOGB0} and @code{FP_ILOGBNAN} have wrong values on some
+platforms:
+Haiku 2017.
+
 @item
 The macros @code{NAN}, @code{HUGE_VALL}, and @code{INFINITY} are not
 defined on some platforms:
index f2201516024af52dd71cf3a48bb6651bb769df10..09f822aa5e37146b870de3017a5e058b784ef6a9 100644 (file)
@@ -194,8 +194,17 @@ _NaN ()
 #endif
 
 
-/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined.  */
-#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
+#if defined FP_ILOGB0 && defined FP_ILOGBNAN
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are correct.  */
+# if defined __HAIKU__
+  /* Haiku: match what ilogb() does */
+#  undef FP_ILOGB0
+#  undef FP_ILOGBNAN
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#else
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined.  */
 # if defined __NetBSD__ || defined __sgi
   /* NetBSD, IRIX 6.5: match what ilogb() does */
 #  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
index 1d56ecbf44c8a7888250d1d50025aa6e1fa2f94e..a73d7ad6f37201decfa6f385cafefc2048036120 100644 (file)
@@ -1,4 +1,4 @@
-# ilogb.m4 serial 2
+# ilogb.m4 serial 3
 dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,7 +57,15 @@ AC_DEFUN([gl_FUNC_ILOGB_WORKS],
 #include <limits.h>
 #include <math.h>
 /* Provide FP_ILOGB0, FP_ILOGBNAN, like in math.in.h.  */
-#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
+#if defined FP_ILOGB0 && defined FP_ILOGBNAN
+# if defined __HAIKU__
+  /* Haiku: match what ilogb() does */
+#  undef FP_ILOGB0
+#  undef FP_ILOGBNAN
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#else
 # if defined __NetBSD__ || defined __sgi
   /* NetBSD, IRIX 6.5: match what ilogb() does */
 #  define FP_ILOGB0   INT_MIN
index 4e16e07aabcbedad014a233d9bbf81a2e8aeafa0..a660108dccdec7b6bc09089c0b9ab02ece217037 100644 (file)
@@ -1,4 +1,4 @@
-# ilogbf.m4 serial 2
+# ilogbf.m4 serial 3
 dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,7 +59,15 @@ AC_DEFUN([gl_FUNC_ILOGBF_WORKS],
 #include <limits.h>
 #include <math.h>
 /* Provide FP_ILOGB0, FP_ILOGBNAN, like in math.in.h.  */
-#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
+#if defined FP_ILOGB0 && defined FP_ILOGBNAN
+# if defined __HAIKU__
+  /* Haiku: match what ilogb() does */
+#  undef FP_ILOGB0
+#  undef FP_ILOGBNAN
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#else
 # if defined __NetBSD__ || defined __sgi
   /* NetBSD, IRIX 6.5: match what ilogbf() does */
 #  define FP_ILOGB0   INT_MIN