Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75486 - trunk/boost/math/tools
From: john_at_[hidden]
Date: 2011-11-14 07:20:15


Author: johnmaddock
Date: 2011-11-14 07:20:13 EST (Mon, 14 Nov 2011)
New Revision: 75486
URL: http://svn.boost.org/trac/boost/changeset/75486

Log:
Tentative fix for platforms that have fenv.h but no fexcept_t.
Text files modified:
   trunk/boost/math/tools/config.hpp | 16 +++++++++++++---
   1 files changed, 13 insertions(+), 3 deletions(-)

Modified: trunk/boost/math/tools/config.hpp
==============================================================================
--- trunk/boost/math/tools/config.hpp (original)
+++ trunk/boost/math/tools/config.hpp 2011-11-14 07:20:13 EST (Mon, 14 Nov 2011)
@@ -265,7 +265,9 @@
 
    #include <boost/detail/fenv.hpp>
 
- namespace boost{ namespace math{
+# ifdef FE_ALL_EXCEPT
+
+namespace boost{ namespace math{
    namespace detail
    {
    struct fpu_guard
@@ -286,8 +288,16 @@
    } // namespace detail
    }} // namespaces
 
-# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object;
-# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0);
+# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object;
+# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0);
+
+# else
+
+# define BOOST_FPU_EXCEPTION_GUARD
+# define BOOST_MATH_INSTRUMENT_FPU
+
+# endif
+
 #else // All other platforms.
 # define BOOST_FPU_EXCEPTION_GUARD
 # define BOOST_MATH_INSTRUMENT_FPU


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk