From 4d699c3727abd33573584053c3d272b92f5b4f1a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 19 Oct 2011 11:09:37 +0200 Subject: [PATCH] Support for old NeXTstep 3.3 frexp(). * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm. Limit the execution time of the test to 5 seconds. Reported by Daniel Richard G. . --- ChangeLog | 7 +++++++ m4/frexp.m4 | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19bd1796ba..a2f95ec98b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-19 Bruno Haible + + Support for old NeXTstep 3.3 frexp(). + * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm. Limit the + execution time of the test to 5 seconds. + Reported by Daniel Richard G. . + 2011-10-19 Bruno Haible Support for old NeXTstep 3.3 sed. diff --git a/m4/frexp.m4 b/m4/frexp.m4 index f2048f3be3..b0bdd106b0 100644 --- a/m4/frexp.m4 +++ b/m4/frexp.m4 @@ -1,4 +1,4 @@ -# frexp.m4 serial 12 +# frexp.m4 serial 13 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -93,6 +93,7 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([alarm]) AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works], [ AC_RUN_IFELSE( @@ -100,6 +101,9 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS], #include #include #include +#if HAVE_ALARM +# include +#endif /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. ICC 10.0 has a bug when optimizing the expression -zero. The expression -DBL_MIN * DBL_MIN does not work when cross-compiling @@ -120,6 +124,11 @@ int main() int i; volatile double x; double zero = 0.0; +#if HAVE_ALARM + /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite + number. Let the test fail in this case. */ + alarm (5); +#endif /* Test on denormalized numbers. */ for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) ; -- 2.39.5