summaryrefslogtreecommitdiff
path: root/lib/isnanf-nolibm.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isnanf-nolibm.h')
-rw-r--r--lib/isnanf-nolibm.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h
index 9e55c6c1a..ba609d5d3 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-2017 Free Software Foundation, Inc.
+ Copyright (C) 2007-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -12,15 +12,16 @@
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#if HAVE_ISNANF_IN_LIBC
/* Get declaration of isnan macro or (older) isnanf function. */
# include <math.h>
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+ GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */
# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
+# define isnanf(x) __builtin_isnan ((float)(x))
# elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))