]> Savannah Git Hosting - gnulib.git/commitdiff
isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jun 2024 16:34:36 +0000 (18:34 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 23:18:23 +0000 (01:18 +0200)
* lib/isnanf-nolibm.h (HAVE_ISNANF_NOLIBM): New macro.
* lib/isnand-nolibm.h (HAVE_ISNAND_NOLIBM): New macro.
* lib/isnanl-nolibm.h (HAVE_ISNANL_NOLIBM): New macro.
* lib/math.h (isnanf): Don't define via isnan if HAVE_ISNANF_NOLIBM is
defined.
(isnand): Don't define via isnan if HAVE_ISNAND_NOLIBM is defined.
(isnanl): Don't define via isnan if HAVE_ISNANL_NOLIBM is defined.

ChangeLog
lib/isnand-nolibm.h
lib/isnanf-nolibm.h
lib/isnanl-nolibm.h
lib/math.in.h

index 8e09876ea0f198f52b59b256c4fc5bebf548dfe1..d630164e42279f6b48eaff48997cca1672170c8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-06-02  Bruno Haible  <bruno@clisp.org>
+
+       isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
+       * lib/isnanf-nolibm.h (HAVE_ISNANF_NOLIBM): New macro.
+       * lib/isnand-nolibm.h (HAVE_ISNAND_NOLIBM): New macro.
+       * lib/isnanl-nolibm.h (HAVE_ISNANL_NOLIBM): New macro.
+       * lib/math.h (isnanf): Don't define via isnan if HAVE_ISNANF_NOLIBM is
+       defined.
+       (isnand): Don't define via isnan if HAVE_ISNAND_NOLIBM is defined.
+       (isnanl): Don't define via isnan if HAVE_ISNANL_NOLIBM is defined.
+
 2024-05-31  Bruno Haible  <bruno@clisp.org>
 
        windows-once: Improve comments.
index bb5a38b39f05c1b68dcafa7a058cb9e2ac287c42..1ac8ab9dcf19059109884a0662e5f88f268ff985 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2023 Free Software Foundation, Inc.
+   Copyright (C) 2007-2024 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -36,3 +36,6 @@
 # define isnand rpl_isnand
 extern int isnand (double x);
 #endif
+
+/* Tell <math.h> that our isnand does not need libm.  */
+#define HAVE_ISNAND_NOLIBM 1
index f4bcba143e6349a013f9212ca226fc39f0e8571e..01f3bfea123bf0cccb18129a1ef7aa2761aefde6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2023 Free Software Foundation, Inc.
+   Copyright (C) 2007-2024 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -44,3 +44,6 @@ extern int isnanf (float x);
 # define isnanf rpl_isnanf
 extern int isnanf (float x);
 #endif
+
+/* Tell <math.h> that our isnanf does not need libm.  */
+#define HAVE_ISNANF_NOLIBM 1
index 8becc5b409eb333d8553b5b46058734c7ed2dee7..71a4d49d771cac65297cf6f3bfd52f9f65e7216d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2023 Free Software Foundation, Inc.
+   Copyright (C) 2007-2024 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -37,3 +37,6 @@
 # define isnanl rpl_isnanl
 extern int isnanl (long double x);
 #endif
+
+/* Tell <math.h> that our isnanl does not need libm.  */
+#define HAVE_ISNANL_NOLIBM 1
index 4b00bf78a6cbc0422ba70fe609e29df355fe20c5..014efc7e3cdebf1531aa493dba1eaa960f6cb231 100644 (file)
@@ -2557,7 +2557,7 @@ _GL_EXTERN_C int isnanf (float x);
        GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't.  */
 #    undef isnanf
 #    define isnanf(x) __builtin_isnan ((float)(x))
-#   elif defined isnan
+#   elif defined isnan && !defined HAVE_ISNANF_NOLIBM
 #    undef isnanf
 #    define isnanf(x) isnan ((float)(x))
 #   endif
@@ -2586,7 +2586,7 @@ _GL_EXTERN_C int isnand (double x);
     /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.  */
 #    undef isnand
 #    define isnand(x) __builtin_isnan ((double)(x))
-#   else
+#   elif !defined HAVE_ISNAND_NOLIBM
 #    undef isnand
 #    define isnand(x) isnan ((double)(x))
 #   endif
@@ -2609,7 +2609,7 @@ _GL_EXTERN_C int isnand (double x);
        GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't.  */
 #   undef isnanl
 #   define isnanl(x) __builtin_isnan ((long double)(x))
-#  elif defined isnan
+#  elif defined isnan && !defined HAVE_ISNANL_NOLIBM
 #   undef isnanl
 #   define isnanl(x) isnan ((long double)(x))
 #  endif