diff --git a/configure.in b/configure.in index 35e04739d2..f993a1bc3e 100644 --- a/configure.in +++ b/configure.in @@ -1883,6 +1883,7 @@ AC_CHECK_FUNCS(gettimeofday) # for making ac_cv_func_gettimeofday AC_CHECK_FUNCS(gmtime_r) AC_CHECK_FUNCS(initgroups) AC_CHECK_FUNCS(ioctl) +AC_CHECK_FUNCS(isfinite) AC_CHECK_FUNCS(issetugid) AC_CHECK_FUNCS(killpg) AC_CHECK_FUNCS(lchmod) diff --git a/numeric.c b/numeric.c index 734ab3455b..f4233d9460 100644 --- a/numeric.c +++ b/numeric.c @@ -30,8 +30,12 @@ #include #endif +#if !defined HAVE_ISFINITE && !defined isfinite #if defined HAVE_FINITE && !defined finite && !defined _WIN32 extern int finite(double); +# define HAVE_ISFINITE 1 +# define isfinite(x) finite(x) +#endif #endif /* use IEEE 64bit values if not defined */ @@ -1457,8 +1461,8 @@ flo_is_finite_p(VALUE num) { double value = RFLOAT_VALUE(num); -#if HAVE_FINITE - if (!finite(value)) +#if HAVE_ISFINITE + if (!isfinite(value)) return Qfalse; #else if (isinf(value) || isnan(value))