newlib/winsup/mingw/mingwex/fegetenv.c
Danny Smith a174593722 * mingwex/fegetenv.c (fegetenv): Restore exception masks.
* mingwex/feholdexcept.c (feholdexcept): Don't set exceptions
	to non-stop. Use "fnclex" to clear exception flags.
2005-10-08 02:14:45 +00:00

15 lines
399 B
C

#include <fenv.h>
/* 7.6.4.1
The fegetenv function stores the current floating-point environment
in the object pointed to by envp. */
int fegetenv (fenv_t * envp)
{
__asm__ ("fnstenv %0;": "=m" (*envp));
/* fnstenv sets control word to non-stop for all exceptions, so we
need to reload our env to restore the original mask. */
__asm__ ("fldenv %0" : : "m" (*envp));
return 0;
}