From: Chris Hanson Date: Fri, 24 Dec 2010 04:37:31 +0000 (-0800) Subject: Fix floenv issues with MacOSX. X-Git-Tag: 20110426-Gtk~18 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f5b202363220c32598a3fe24991f5471040312e1;p=mit-scheme.git Fix floenv issues with MacOSX. --- 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