From: Bruno Haible Date: Sun, 2 Jun 2024 16:34:36 +0000 (+0200) Subject: isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=6a753ba2b566f10bd2c5e68a5decd090db0dc52f;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 8e09876ea0..d630164e42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-06-02 Bruno Haible + + 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 windows-once: Improve comments. diff --git a/lib/isnand-nolibm.h b/lib/isnand-nolibm.h index bb5a38b39f..1ac8ab9dcf 100644 --- a/lib/isnand-nolibm.h +++ b/lib/isnand-nolibm.h @@ -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 that our isnand does not need libm. */ +#define HAVE_ISNAND_NOLIBM 1 diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h index f4bcba143e..01f3bfea12 100644 --- a/lib/isnanf-nolibm.h +++ b/lib/isnanf-nolibm.h @@ -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 that our isnanf does not need libm. */ +#define HAVE_ISNANF_NOLIBM 1 diff --git a/lib/isnanl-nolibm.h b/lib/isnanl-nolibm.h index 8becc5b409..71a4d49d77 100644 --- a/lib/isnanl-nolibm.h +++ b/lib/isnanl-nolibm.h @@ -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 that our isnanl does not need libm. */ +#define HAVE_ISNANL_NOLIBM 1 diff --git a/lib/math.in.h b/lib/math.in.h index 4b00bf78a6..014efc7e3c 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -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