summaryrefslogtreecommitdiff
path: root/m4/isnanl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/isnanl.m4')
-rw-r--r--m4/isnanl.m417
1 files changed, 13 insertions, 4 deletions
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index 9874418a69..75d5462975 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 20
+# isnanl.m4 serial 21
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -68,7 +68,10 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #ifndef __has_builtin
+ # define __has_builtin(name) 0
+ #endif
+ #if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
#elif defined isnan
@@ -93,7 +96,10 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #ifndef __has_builtin
+ # define __has_builtin(name) 0
+ #endif
+ #if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
#elif defined isnan
@@ -123,7 +129,10 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
#include <float.h>
#include <limits.h>
#include <math.h>
-#if __GNUC__ >= 4
+#ifndef __has_builtin
+# define __has_builtin(name) 0
+#endif
+#if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
#elif defined isnan