[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:56:22 UTC 2009


The following commit has been merged in the upstream branch:
commit b3bd644031063f0cb23e536e59043fb1e4b39af3
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri May 1 18:23:08 2009 +1000

    Divide-by-zero exceptions use <fenv.h>
    
    Ignore-this: e27ddc2f2fdf80ccabc8a4ceac68a5d
    
    darcs-hash:20090501082308-d4795-36fbb3654c6052727ae93be60d8d2d89d2e733e3.gz

diff --git a/configure.in b/configure.in
index b5982c8..9f5b2fd 100644
--- a/configure.in
+++ b/configure.in
@@ -315,12 +315,7 @@ AM_CONDITIONAL(BUILD_STOKES, test x$F77 != x)
 AM_CONDITIONAL(BUILD_WAVEWATCH, test -r $HOME/.wwatch3.env)
 
 dnl header file checks
-AC_CHECK_HEADERS(fpu_control.h,
-  AC_CHECK_DECL(_FPU_SETCW, 
-                AC_DEFINE(HAVE_FPU_SETCW,,[Define to 1 if you have _FPU_SETCW]),,
-                [#include <fpu_control.h>])
-)
-
+AC_CHECK_HEADERS(fenv.h, AC_DEFINE(HAVE_FENV_H))
 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
 AC_CHECK_HEADERS(getopt.h, AC_DEFINE(HAVE_GETOPT_H))
 
diff --git a/src/init.c b/src/init.c
index 2192529..3112d00 100644
--- a/src/init.c
+++ b/src/init.c
@@ -19,11 +19,10 @@
 
 #include "config.h"
 
-#ifdef HAVE_FPU_SETCW
-# include <fpu_control.h>
-  static fpu_control_t fpu_trap_exceptions = 
-       _FPU_IEEE & ~(_FPU_MASK_ZM /*| _FPU_MASK_IM | _FPU_MASK_OM*/);
-#endif /* HAVE_FPU_SETCW */
+#ifdef HAVE_FENV_H
+# define _GNU_SOURCE
+# include <fenv.h>
+#endif /* HAVE_FENV_H */
 
 #include <stdlib.h>
 #include <locale.h>
@@ -266,9 +265,11 @@ void gfs_init (int * argc, char *** argv)
 #endif /* HAVE_MPI */
   initialized = TRUE;
 
-#ifdef HAVE_FPU_SETCW
-   _FPU_SETCW (fpu_trap_exceptions);
-#endif /* HAVE_FPU_SETCW */
+#ifdef FE_NOMASK_ENV
+# ifdef FE_DIVBYZERO
+  feenableexcept (FE_DIVBYZERO);
+# endif /* FE_DIVBYZERO */
+#endif /* FE_NO_MASK_ENV */
 
   g_log_set_handler (G_LOG_DOMAIN,
 		     G_LOG_LEVEL_ERROR |

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list