5 #if defined(__APPLE__) && defined(__MACH__) 10 inline int feenableexcept(
unsigned int excepts)
13 unsigned int new_excepts = excepts & FE_ALL_EXCEPT;
15 unsigned int old_excepts;
17 if (fegetenv(&fenv)) {
20 old_excepts = fenv.__control & FE_ALL_EXCEPT;
23 fenv.__control &= ~new_excepts;
24 fenv.__mxcsr &= ~(new_excepts << 7);
26 return fesetenv(&fenv) ? -1 : old_excepts;
29 inline int fedisableexcept(
unsigned int excepts)
32 unsigned int new_excepts = excepts & FE_ALL_EXCEPT;
34 unsigned int old_excepts;
36 if (fegetenv(&fenv)) {
39 old_excepts = fenv.__control & FE_ALL_EXCEPT;
42 fenv.__control |= new_excepts;
43 fenv.__mxcsr |= new_excepts << 7;
45 return fesetenv(&fenv) ? -1 : old_excepts;