summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/fpectlmodule.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/fpectlmodule.c b/Modules/fpectlmodule.c
index 8034489..ff3ea76 100644
--- a/Modules/fpectlmodule.c
+++ b/Modules/fpectlmodule.c
@@ -195,7 +195,14 @@ static void fpe_reset(Sigfunc *handler)
#else
#include <i386/fpu_control.h>
#endif
+#ifdef _FPU_SETCW
+ {
+ fpu_control_t cw = 0x1372;
+ _FPU_SETCW(cw);
+ }
+#else
__setfpucw(0x1372);
+#endif
PyOS_setsig(SIGFPE, handler);
/*-- NeXT -----------------------------------------------------------------*/