[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:51:47 UTC 2009
The following commit has been merged in the upstream branch:
commit 039ed70046be6f049a67119133e90d97fb635a26
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Thu Apr 7 14:08:10 2005 +1000
More robust (hopefully) FPU exceptions control
darcs-hash:20050407040810-fbd8f-67d41b85d22498e4bccd3e7edd61d28ba5058d8b.gz
diff --git a/configure.in b/configure.in
index 36f902b..a6c15aa 100644
--- a/configure.in
+++ b/configure.in
@@ -278,7 +278,12 @@ AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
dnl header file checks
-AC_CHECK_HEADERS(fpu_control.h, AC_DEFINE(HAVE_FPU_CONTROL_H))
+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(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 4b592c1..8545783 100644
--- a/src/init.c
+++ b/src/init.c
@@ -19,13 +19,11 @@
#include "config.h"
-#ifdef HAVE_FPU_CONTROL_H
-# include <fpu_control.h>
-# ifdef _FPU_IEEE
- static fpu_control_t fpu_trap_exceptions =
- _FPU_IEEE & ~(_FPU_MASK_ZM /*| _FPU_MASK_IM | _FPU_MASK_OM*/);
-# endif /* _FPU_IEEE */
-#endif /* HAVE_FPU_CONTROL_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 */
#include <stdlib.h>
#include "boundary.h"
@@ -140,11 +138,9 @@ void gfs_init (int * argc, char *** argv)
#endif /* HAVE_MPI */
initialized = TRUE;
-#ifdef HAVE_FPU_CONTROL_H
-# ifdef _FPU_IEEE
- _FPU_SETCW (fpu_trap_exceptions);
-# endif /* _FPU_IEEE */
-#endif /* HAVE_FPU_CONTROL_H */
+#ifdef HAVE_FPU_SETCW
+ _FPU_SETCW (fpu_trap_exceptions);
+#endif /* HAVE_FPU_SETCW */
g_log_set_handler (G_LOG_DOMAIN,
G_LOG_LEVEL_ERROR |
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list