* 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>.
+2012-02-28 Bruno Haible <bruno@clisp.org>
+
+ 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>.
+
2012-02-27 Bruno Haible <bruno@clisp.org>
Tests for module 'sqrtl-ieee'.
# 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
+
/* 2^(MANT_DIG-1). */
static const DOUBLE TWO_MANT_DIG =
/* Assume MANT_DIG <= 5 * 31.
# define L_(literal) literal##f
#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
+
/* 2^(MANT_DIG-1). */
static const DOUBLE TWO_MANT_DIG =
/* Assume MANT_DIG <= 5 * 31.
#undef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
+/* 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
+
/* It is possible to write an implementation of fused multiply-add with
floating-point operations alone. See
Sylvie Boldo, Guillaume Melquiond:
#include "float+.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
+
#define NBITS (sizeof (unsigned int) * CHAR_BIT)
int
# 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
+
DOUBLE
RINT (DOUBLE x)
{
# 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. */
# 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
+
/* 2^(MANT_DIG-1). */
static const DOUBLE TWO_MANT_DIG =
/* Assume MANT_DIG <= 5 * 31.
-# round.m4 serial 13
+# round.m4 serial 14
dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <float.h>
#include <math.h>
+#ifdef _MSC_VER
+# pragma fenv_access (off)
+#endif
int main()
{
/* 2^DBL_MANT_DIG. */
-# roundf.m4 serial 14
+# roundf.m4 serial 15
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <float.h>
#include <math.h>
+#ifdef _MSC_VER
+# pragma fenv_access (off)
+#endif
int main()
{
/* 2^FLT_MANT_DIG. */
#include "minus-zero.h"
#include "macros.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
+
/* The reference implementation, taken from lib/ceil.c. */
#include "minus-zero.h"
#include "macros.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
+
/* The reference implementation, taken from lib/ceil.c. */
#include "isnand-nolibm.h"
#include "macros.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
+
/* The reference implementation, taken from lib/floor.c. */
#include "isnanf-nolibm.h"
#include "macros.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
+
/* The reference implementation, taken from lib/floor.c. */
#include "minus-zero.h"
#include "macros.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
+
/* The reference implementation, taken from lib/trunc.c. */
#include "minus-zero.h"
#include "macros.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
+
/* The reference implementation, taken from lib/trunc.c. */