-# isnanf.m4 serial 8
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# isnanf.m4 serial 11
+dnl Copyright (C) 2007-2010 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.
AC_DEFUN([gl_FUNC_ISNANF],
[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
ISNANF_LIBM=
gl_HAVE_ISNANF_NO_LIBM
if test $gl_cv_func_isnanf_no_libm = no; then
else
gl_func_isnanf=no
fi
- if test $gl_func_isnanf = yes; then
- AC_DEFINE([HAVE_ISNANF], 1,
- [Define if the isnan(float) function is available.])
- else
+ if test $gl_func_isnanf != yes; then
+ HAVE_ISNANF=0
gl_BUILD_ISNANF
fi
AC_SUBST([ISNANF_LIBM])
*) false;;
esac
}; then
- AC_DEFINE([HAVE_ISNANF_IN_LIBC], 1,
+ AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1],
[Define if the isnan(float) function is available in libc.])
else
gl_BUILD_ISNANF
AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm],
[gl_cv_func_isnanf_no_libm],
[
- AC_TRY_LINK([#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;],
- [return isnanf (x);],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ #if __GNUC__ >= 4
+ # undef isnanf
+ # define isnanf(x) __builtin_isnanf ((float)(x))
+ #elif defined isnan
+ # undef isnanf
+ # define isnanf(x) isnan ((float)(x))
+ #endif
+ float x;]],
+ [[return isnanf (x);]])],
[gl_cv_func_isnanf_no_libm=yes],
[gl_cv_func_isnanf_no_libm=no])
])
[
save_LIBS="$LIBS"
LIBS="$LIBS -lm"
- AC_TRY_LINK([#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;],
- [return isnanf (x);],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ #if __GNUC__ >= 4
+ # undef isnanf
+ # define isnanf(x) __builtin_isnanf ((float)(x))
+ #elif defined isnan
+ # undef isnanf
+ # define isnanf(x) isnan ((float)(x))
+ #endif
+ float x;]],
+ [[return isnanf (x);]])],
[gl_cv_func_isnanf_in_libm=yes],
[gl_cv_func_isnanf_in_libm=no])
LIBS="$save_LIBS"
AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <math.h>
#if __GNUC__ >= 4
# undef isnanf
#endif
return 0;
-}], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no],
+}]])],
+ [gl_cv_func_isnanf_works=yes],
+ [gl_cv_func_isnanf_works=no],
[case "$host_os" in
irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
*) gl_cv_func_isnanf_works="guessing yes";;