From f5b202363220c32598a3fe24991f5471040312e1 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 23 Dec 2010 20:37:31 -0800 Subject: [PATCH] Fix floenv issues with MacOSX. --- src/microcode/configure.ac | 2 +- src/microcode/floenv.c | 10 +++++++--- src/microcode/floenv.h | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index 794f9c10b..1ee081116 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -340,7 +340,7 @@ darwin*) AS_FLAGS="-arch x86_64 ${AS_FLAGS}" ;; esac - CFLAGS="${CFLAGS} ${MACOSX_CFLAGS}" + CFLAGS="${CFLAGS} ${MACOSX_CFLAGS} -frounding-math" LDFLAGS="${LDFLAGS} ${MACOSX_CFLAGS} -Wl,-syslibroot,${MACOSX_SYSROOT}" LDFLAGS="${LDFLAGS} -framework CoreFoundation" MODULE_LDFLAGS="${MODULE_LDFLAGS} -bundle" diff --git a/src/microcode/floenv.c b/src/microcode/floenv.c index bdc9d6541..ab69a1f11 100644 --- a/src/microcode/floenv.c +++ b/src/microcode/floenv.c @@ -314,12 +314,15 @@ static const int non_trappable_exceptions = 0 #endif ; +#ifdef HAVE_FEDISABLEEXCEPT static int arg_untrappable_float_exceptions (int n) { return (non_trappable_exceptions | (arg_float_exceptions (n))); } +#endif +#ifdef HAVE_FEENABLEEXCEPT static int arg_trappable_float_exceptions (int n) { @@ -328,7 +331,9 @@ arg_trappable_float_exceptions (int n) error_bad_range_arg (n); return (exceptions); } +#endif +#if ((defined (HAVE_FEENABLEEXCEPT)) && (defined (HAVE_FEDISABLEEXCEPT))) static int arg_float_exceptions_to_trap (int n) { @@ -337,6 +342,7 @@ arg_float_exceptions_to_trap (int n) error_bad_range_arg (n); return (exceptions); } +#endif #define FLOAT_EXCEPTIONS_PRIMITIVE(E) \ { \ @@ -478,8 +484,7 @@ DEFINE_PRIMITIVE ("TRAPPED-FLOAT-EXCEPTIONS", Prim_trapped_float_exceptions, 0, FLOAT_EXCEPTIONS_RESULT (exceptions); } #else - error_unimplemented_primitive (); - PRIMITIVE_RETURN (UNSPECIFIC); + PRIMITIVE_RETURN (ULONG_TO_FIXNUM (0)); #endif } @@ -497,7 +502,6 @@ DEFINE_PRIMITIVE ("SET-TRAPPED-FLOAT-EXCEPTIONS", Prim_set_trapped_float_excepti FLOAT_EXCEPTIONS_RESULT (previous_exceptions); } #else - error_unimplemented_primitive (); PRIMITIVE_RETURN (UNSPECIFIC); #endif } diff --git a/src/microcode/floenv.h b/src/microcode/floenv.h index 70ef9b37d..5141bfccd 100644 --- a/src/microcode/floenv.h +++ b/src/microcode/floenv.h @@ -39,6 +39,9 @@ USA. # ifdef HAVE_FEXCEPT_T # define scheme_fexcept_t fexcept_t # endif +# ifdef __APPLE__ +# undef HAVE_FEGETEXCEPT +# endif #elif ((!defined (CMPINTMD_EMULATES_FENV)) && (defined (HAVE_IEEEFP_H))) /* Assumption: If we have , then we don't need to test for -- 2.25.1