summaryrefslogtreecommitdiff
path: root/lib/round.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-02-28 11:50:03 +0100
committerBruno Haible <bruno@clisp.org>2012-02-28 11:50:03 +0100
commitab1bdfa5247c71e8a0f34e44e6cab5dde9397e72 (patch)
tree3a34f7428ba30bfaf0db4b2fe0afc47e80b83a2f /lib/round.c
parenta21247c3daf904f4770ad267338a3888c1d36959 (diff)
downloadgnulib-ab1bdfa5247c71e8a0f34e44e6cab5dde9397e72.tar.gz
Avoid compilation errors with MSVC option -fp:strict.
* lib/floor.c: Use MSVC specific pragma fenv_access. * lib/ceil.c: Likewise. * lib/trunc.c: Likewise. * lib/round.c: Likewise. * lib/rint.c: Likewise. * lib/fma.c: Likewise. * lib/integer_length.c: Likewise. * m4/round.m4 (gl_FUNC_ROUND): Likewise. * m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise. * tests/test-floor2.c: Likewise. * tests/test-floorf2.c: Likewise. * tests/test-ceil2.c: Likewise. * tests/test-ceilf2.c: Likewise. * tests/test-trunc2.c: Likewise. * tests/test-truncf2.c: Likewise. Reported by Michael Goffioul <michael.goffioul@gmail.com>.
Diffstat (limited to 'lib/round.c')
-rw-r--r--lib/round.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/round.c b/lib/round.c
index 0933484070..b52bd35858 100644
--- a/lib/round.c
+++ b/lib/round.c
@@ -64,6 +64,12 @@
# define MINUS_ZERO L_(-0.0)
#endif
+/* 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
+
/* If we're being included from test-round2[f].c, it already defined names for
our round implementations. Otherwise, pick the preferred implementation for
this machine. */