]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid compilation errors with MSVC option -fp:strict.
authorBruno Haible <bruno@clisp.org>
Tue, 13 Mar 2012 22:57:11 +0000 (23:57 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 13 Mar 2012 22:57:11 +0000 (23:57 +0100)
* lib/cbrt.c: Use MSVC specific pragma fenv_access.
* lib/cbrtf.c: Likewise.
Reported by Michael Goffioul <michael.goffioul@gmail.com>.

ChangeLog
lib/cbrt.c
lib/cbrtf.c

index 7d09ceffd77874c18fc3495cf92aef196abb386f..634e107ff29c262c6daa4a090f0de58f232572f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-13  Bruno Haible  <bruno@clisp.org>
+
+       Avoid compilation errors with MSVC option -fp:strict.
+       * lib/cbrt.c: Use MSVC specific pragma fenv_access.
+       * lib/cbrtf.c: Likewise.
+       Reported by Michael Goffioul <michael.goffioul@gmail.com>.
+
 2012-03-12  Bruno Haible  <bruno@clisp.org>
 
        uninorm: Don't crash in out-of-memory conditions.
index d3659f0a6f632355dae85e7188545ab18216a48e..d4ca9cb68adfa974588747caeb3f10ecb9ff4637 100644 (file)
 /* Specification.  */
 #include <math.h>
 
+/* MSVC with option -fp:strict refuses to compile constant initializers that
+   contain floating-point operations.  Pacify this compiler.  */
+#ifdef _MSC_VER
+# pragma fenv_access (off)
+#endif
+
 /* Code based on glibc/sysdeps/ieee754/dbl-64/s_cbrt.c.  */
 
 #define CBRT2 1.2599210498948731648             /* 2^(1/3) */
index 6320d0e6bca7a628e825f4d838f463ae000f1c38..34d6338498c837a53f8ae82f3829b4bef800dfc2 100644 (file)
 /* Specification.  */
 #include <math.h>
 
+/* MSVC with option -fp:strict refuses to compile constant initializers that
+   contain floating-point operations.  Pacify this compiler.  */
+#ifdef _MSC_VER
+# pragma fenv_access (off)
+#endif
+
 /* Code based on glibc/sysdeps/ieee754/flt-32/s_cbrtf.c.  */
 
 #define CBRT2 1.2599210498948731648             /* 2^(1/3) */