summaryrefslogtreecommitdiff
path: root/m4/isinf.m4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-09-08 00:34:27 +0200
committerLudovic Courtès <ludo@gnu.org>2010-09-08 00:34:27 +0200
commit2e65b52f8a2e5f82ddc8da471d989f14468f8b90 (patch)
treec7d6b3a20e87029b46137e6a9bb80642edd3be1c /m4/isinf.m4
parent18f2d5aa4dfe66469d4b109e5b56b931a057a3e0 (diff)
downloadguile-2e65b52f8a2e5f82ddc8da471d989f14468f8b90.tar.gz
Use Gnulib's `isnan' and `isinf' modules.
This updates Gnulib to v0.0-4219-g84cdd8b. * m4/gnulib-cache.m4: Add `isinf' and `isnan'. * configure.ac: Remove checks for `floatingpoint.h', `ieeefp.h', and `nan.h'. * libguile/gen-scmconfig.c (main): Remove definitions of `SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', and `SCM_HAVE_NAN_H'. * libguile/numbers.c (isnan)[SCO && !HAVE_ISNAN]: Remove. (isinf)[SCO && !HAVE_ISINF]: Remove. (xisinf, xisnan): Remove. Change callers to use `isinf' and `isnan'. (guile_ieee_init): Remove the `defined HAVE_ISINF' and `define HAVE_ISNAN' conditions. * libguile/numbers.h: Remove code conditional on `SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', or `SCM_HAVE_NAN_H'.
Diffstat (limited to 'm4/isinf.m4')
-rw-r--r--m4/isinf.m448
1 files changed, 48 insertions, 0 deletions
diff --git a/m4/isinf.m4 b/m4/isinf.m4
new file mode 100644
index 000000000..6a2412350
--- /dev/null
+++ b/m4/isinf.m4
@@ -0,0 +1,48 @@
+# isinf.m4 serial 3
+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_ISINF],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare isinf.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_DECLS([isinf], , , [#include <math.h>])
+ if test "$ac_cv_have_decl_isinf" = yes; then
+ gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x);])
+ if test "$ISINF_LIBM" != missing; then
+ dnl Test whether isinf() on 'long double' works.
+ gl_ISINFL_WORKS
+ case "$gl_cv_func_isinfl_works" in
+ *yes) ;;
+ *) ISINF_LIBM=missing;;
+ esac
+ fi
+ fi
+ if test "$ac_cv_have_decl_isinf" != yes ||
+ test "$ISINF_LIBM" = missing; then
+ REPLACE_ISINF=1
+ AC_LIBOBJ([isinf])
+ ISINF_LIBM=
+ fi
+ AC_SUBST([ISINF_LIBM])
+])
+
+dnl Test whether isinf() correctly returns false for LDBL_MAX.
+AC_DEFUN([gl_ISINFL_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether isinf(long double) works], [gl_cv_func_isinfl_works],
+ [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <float.h>
+ #include <math.h>]],
+ [[return !!isinf(LDBL_MAX);]])],
+ [gl_cv_func_isinfl_works=yes],
+ [gl_cv_func_isinfl_works=no],
+ [gl_cv_func_isinfl_works="guessing no"])
+ ])
+])