>From e9c6d7cc8e23bc207d0319c8f2916de8424b597a Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 23 Feb 2014 13:30:43 +0100 Subject: [PATCH] Fix isnormal() problem on MingW by using gcc builtin instead of the macro from mingw's header-files. Restore the tests as well --- chicken.h | 5 +++++ tests/library-tests.scm | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chicken.h b/chicken.h index 6b4f63c..6dfefb9 100644 --- a/chicken.h +++ b/chicken.h @@ -368,6 +368,11 @@ static inline int isinf_ld (long double x) { return !isnan (x) && isnan (x - x); } #endif +/* Mingw's isnormal() is broken on 32bit; use GCC's builtin (see #1062) */ +#ifdef __MINGW32__ +# undef isnormal +# define isnormal __builtin_isnormal +#endif /* Constants: */ diff --git a/tests/library-tests.scm b/tests/library-tests.scm index e8a429b..bbe2719 100644 --- a/tests/library-tests.scm +++ b/tests/library-tests.scm @@ -90,14 +90,12 @@ ;;; A few denormalised numbers, cribbed from NetBSD ATF tests for ldexp(): ;; On some machines/OSes these tests fail due to missing hardware support ;; and sometimes due to broken libc/libm support, so we have disabled them. -#| (assert (equal? 1.0 (numerator 1.1125369292536006915451e-308))) (assert (equal? +inf.0 (denominator 1.1125369292536006915451e-308))) (assert (equal? -1.0 (numerator -5.5626846462680034577256e-309))) (assert (equal? +inf.0 (denominator -5.5626846462680034577256e-309))) (assert (equal? 1.0 (numerator 4.9406564584124654417657e-324))) (assert (equal? +inf.0 (denominator 4.9406564584124654417657e-324))) -|# (assert (equal? 4.0 (denominator -1.25))) (assert (equal? 1e10 (numerator 1e10))) -- 1.7.10.4