From: Bruno Haible Date: Tue, 13 Mar 2012 22:57:11 +0000 (+0100) Subject: Avoid compilation errors with MSVC option -fp:strict. X-Git-Tag: v0.1~833 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=843f36dd9708aec052ed2410232b57048201ba61;p=gnulib.git 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 . --- diff --git a/ChangeLog b/ChangeLog index 7d09ceffd..634e107ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-03-13 Bruno Haible + + 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 . + 2012-03-12 Bruno Haible uninorm: Don't crash in out-of-memory conditions. diff --git a/lib/cbrt.c b/lib/cbrt.c index d3659f0a6..d4ca9cb68 100644 --- a/lib/cbrt.c +++ b/lib/cbrt.c @@ -22,6 +22,12 @@ /* Specification. */ #include +/* 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) */ diff --git a/lib/cbrtf.c b/lib/cbrtf.c index 6320d0e6b..34d633849 100644 --- a/lib/cbrtf.c +++ b/lib/cbrtf.c @@ -22,6 +22,12 @@ /* Specification. */ #include +/* 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) */