+2008-01-26 Bruno Haible <bruno@clisp.org>
+
+ * m4/isnanf.m4 (gl_HAVE_ISNANF_NO_LIBM, gl_ISNANF_WORKS): Test the
+ GCC >= 4.0 built-in.
+ * lib/isnanf.h (isnanf): Use the GCC >= 4.0 built-in.
+
2008-01-26 Bruno Haible <bruno@clisp.org>
Rename isnan, applicable to 'double' only, to isnand.
/* Test for NaN that does not need libm.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#if HAVE_ISNANF_IN_LIBC
/* Get declaration of isnan macro or (older) isnanf function. */
# include <math.h>
-# ifdef isnan
+# if __GNUC__ >= 4
+ /* GCC 4.0 and newer provides three built-ins for isnan. */
+# undef isnanf
+# define isnanf(x) __builtin_isnanf ((float)(x))
+# elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
# endif
-# isnanf.m4 serial 4
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# isnanf.m4 serial 5
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
[gl_cv_func_isnanf_no_libm],
[
AC_TRY_LINK([#include <math.h>
- #ifdef isnan
+ #if __GNUC__ >= 4
+ # undef isnanf
+ # define isnanf(x) __builtin_isnanf ((float)(x))
+ #elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif
[
AC_TRY_RUN([
#include <math.h>
-#ifdef isnan
+#if __GNUC__ >= 4
+# undef isnanf
+# define isnanf(x) __builtin_isnanf ((float)(x))
+#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif