From: Chris Hanson Date: Mon, 26 Aug 2019 03:16:36 +0000 (-0700) Subject: Tweak workaround for floating exceptions on macOS. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~65 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6de490ce0890854d0b92369d37faa569fdc0b3c1;p=mit-scheme.git Tweak workaround for floating exceptions on macOS. --- diff --git a/src/microcode/floenv.h b/src/microcode/floenv.h index 35ec37ab0..3d0189c28 100644 --- a/src/microcode/floenv.h +++ b/src/microcode/floenv.h @@ -41,12 +41,20 @@ USA. # define scheme_fexcept_t fexcept_t # endif # ifdef __APPLE__ -# undef HAVE_FEGETEXCEPT +# ifndef HAVE_FEGETEXCEPT +# define HAVE_FEGETEXCEPT +# endif # define HAVE_FEENABLEEXCEPT # define HAVE_FEDISABLEEXCEPT // From http://www-personal.umich.edu/~williams/archive/computation/fe-handling-example.c +inline int fegetexcept(void) +{ + fenv_t fenv; + return (fegetenv (&fenv)) ? -1 : (fenv.__control & FE_ALL_EXCEPT); +} + inline int feenableexcept(unsigned int excepts) { fenv_t fenv;