]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ALIROOT/fpu.c
macro and flowevent maker to run part of the code in root
[u/mrichter/AliRoot.git] / ALIROOT / fpu.c
index 88f4bc801eb1a28988a0bf03b82531c565ef0954..4fda4d6fec87b64b91a4819a2f3db1a08d356f8c 100644 (file)
@@ -1,10 +1,10 @@
 #ifdef __linux
-#include <fpu_control.h>
-void __attribute__ ((constructor))
-     trapfpe () {
-  fpu_control_t cw = _FPU_DEFAULT & ~(_FPU_MASK_IM | _FPU_MASK_ZM |
-                                     _FPU_MASK_OM);
-  _FPU_SETCW(cw);
+#define _GNU_SOURCE 1
+#include <fenv.h>
+static void __attribute__ ((constructor)) trapfpe(void)
+{
+  /* Enable some exceptions. At startup all exceptions are masked. */
+  feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW);
 }
 #else
 void trapfpe () {}