X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fisnanf.m4;h=cff22369e73f33b3966e92dea153f934dd13d469;hb=cda636671de46bd0c60641ac60d6399662d7af2c;hp=ea75d951e07484257753a14c75fd6be22589b2ff;hpb=40cb8a4b045f26d638c95336c37c91e82f662bad;p=gnulib.git diff --git a/m4/isnanf.m4 b/m4/isnanf.m4 index ea75d951e..cff22369e 100644 --- a/m4/isnanf.m4 +++ b/m4/isnanf.m4 @@ -1,5 +1,5 @@ -# isnanf.m4 serial 3 -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. @@ -13,7 +13,11 @@ AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM], gl_ISNANF_WORKS fi if test $gl_cv_func_isnanf_no_libm = yes \ - && test "$gl_cv_func_isnanf_works" = yes; then + && { case "$gl_cv_func_isnanf_works" in + *yes) true;; + *) false;; + esac + }; then AC_DEFINE([HAVE_ISNANF_IN_LIBC], 1, [Define if the isnan(float) function is available in libc.]) else @@ -29,7 +33,10 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM], [gl_cv_func_isnanf_no_libm], [ AC_TRY_LINK([#include - #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 @@ -50,7 +57,10 @@ AC_DEFUN([gl_ISNANF_WORKS], [ AC_TRY_RUN([ #include -#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 @@ -153,7 +163,7 @@ int main () ], [gl_cv_cc_float_expbit0=`cat conftest.out`], [gl_cv_cc_float_expbit0="unknown"], - [gl_cv_cc_double_expbit0="word 0 bit 23"]) + [gl_cv_cc_float_expbit0="word 0 bit 23"]) rm -f conftest.out ]) case "$gl_cv_cc_float_expbit0" in