Revamp lchown so that it lives in unistd.h where it belongs.
[pspp] / m4 / isnan.m4
index 5bb133d0dceedcaf3c93d390255a0d76dea9e921..de692e69a8053d15af37d7ef7882553a7502ec45 100644 (file)
@@ -1,4 +1,4 @@
-# isnan.m4 serial 1
+# isnan.m4 serial 2
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,12 +8,18 @@ dnl Check how to get or define isnan() without linking with libm.
 
 AC_DEFUN([gl_FUNC_ISNAN_NO_LIBM],
 [
-  AC_CHECK_FUNC([isnan],
-    [gl_cv_func_isnan_no_libm=yes],
-    [gl_cv_func_isnan_no_libm=no])
+  AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm],
+    [gl_cv_func_isnan_no_libm],
+    [
+      AC_TRY_LINK([#include <math.h>
+                   double x;],
+                  [return isnan (x);],
+        [gl_cv_func_isnan_no_libm=yes],
+        [gl_cv_func_isnan_no_libm=no])
+    ])
   if test $gl_cv_func_isnan_no_libm = yes; then
     AC_DEFINE([HAVE_ISNAN_IN_LIBC], 1,
-      [Define if the isnan() function is available in libc.])
+      [Define if the isnan(double) function is available in libc.])
   else
     AC_LIBOBJ([isnan])
     gl_DOUBLE_EXPONENT_LOCATION
@@ -104,10 +110,16 @@ int main ()
             ],
             [gl_cv_cc_double_expbit0="unknown"],
             [
+              pushdef([AC_MSG_CHECKING],[:])dnl
+              pushdef([AC_MSG_RESULT],[:])dnl
+              pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
               AC_C_BIGENDIAN(
                 [gl_cv_cc_double_expbit0="word 0 bit 20"],
                 [gl_cv_cc_double_expbit0="word 1 bit 20"],
                 [gl_cv_cc_double_expbit0="unknown"])
+              popdef([AC_MSG_RESULT_UNQUOTED])dnl
+              popdef([AC_MSG_RESULT])dnl
+              popdef([AC_MSG_CHECKING])dnl
             ])
         ])
       rm -f conftest.out