diff options
Diffstat (limited to 'boost/test/impl/execution_monitor.ipp')
-rw-r--r-- | boost/test/impl/execution_monitor.ipp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/boost/test/impl/execution_monitor.ipp b/boost/test/impl/execution_monitor.ipp index 3ddcf67137..0c5690ca89 100644 --- a/boost/test/impl/execution_monitor.ipp +++ b/boost/test/impl/execution_monitor.ipp @@ -32,7 +32,7 @@ #include <boost/cstdlib.hpp> // for exit codes #include <boost/config.hpp> // for workarounds #include <boost/core/ignore_unused.hpp> // for ignore_unused -#ifndef BOOST_NO_EXCEPTION +#ifndef BOOST_NO_EXCEPTIONS #include <boost/exception/get_error_info.hpp> // for get_error_info #include <boost/exception/current_exception_cast.hpp> // for current_exception_cast #endif @@ -196,7 +196,7 @@ namespace boost { // ************** throw_exception ************** // // ************************************************************************** // -#ifdef BOOST_NO_EXCEPTION +#ifdef BOOST_NO_EXCEPTIONS void throw_exception( std::exception const & e ) { abort(); } #endif @@ -216,7 +216,7 @@ namespace detail { # define BOOST_TEST_VSNPRINTF( a1, a2, a3, a4 ) vsnprintf( (a1), (a2), (a3), (a4) ) #endif -#ifndef BOOST_NO_EXCEPTION +#ifndef BOOST_NO_EXCEPTIONS template <typename ErrorInfo> typename ErrorInfo::value_type @@ -1285,7 +1285,7 @@ execution_monitor::execute( boost::function<int ()> const& F ) catch( ... ) { detail::report_error( execution_exception::cpp_exception_error, "unknown type" ); } -#endif // !BOOST_NO_EXCEPTION +#endif // !BOOST_NO_EXCEPTIONS return 0; // never reached; supplied to quiet compiler warnings } // execute @@ -1354,11 +1354,7 @@ unsigned enable( unsigned mask ) { boost::ignore_unused(mask); - -#if defined(UNDER_CE) - /* Not Implemented in Windows CE */ - return BOOST_FPE_OFF; -#elif defined(BOOST_SEH_BASED_SIGNAL_HANDLING) +#if defined(BOOST_TEST_FPE_SUPPORT_WITH_SEH__) _clearfp(); #if BOOST_WORKAROUND( BOOST_MSVC, <= 1310) @@ -1373,9 +1369,10 @@ enable( unsigned mask ) if( ::_controlfp_s( 0, old_cw & ~mask, BOOST_FPE_ALL ) != 0 ) return BOOST_FPE_INV; #endif - return ~old_cw & BOOST_FPE_ALL; -#elif defined(__GLIBC__) && defined(__USE_GNU) + +#elif defined(BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__) + // same macro definition as in execution_monitor.hpp if (BOOST_FPE_ALL == BOOST_FPE_OFF) /* Not Implemented */ return BOOST_FPE_OFF; @@ -1395,12 +1392,8 @@ disable( unsigned mask ) { boost::ignore_unused(mask); -#if defined(UNDER_CE) - /* Not Implemented in Windows CE */ - return BOOST_FPE_INV; -#elif defined(BOOST_SEH_BASED_SIGNAL_HANDLING) +#if defined(BOOST_TEST_FPE_SUPPORT_WITH_SEH__) _clearfp(); - #if BOOST_WORKAROUND( BOOST_MSVC, <= 1310) unsigned old_cw = ::_controlfp( 0, 0 ); ::_controlfp( old_cw | mask, BOOST_FPE_ALL ); @@ -1413,9 +1406,9 @@ disable( unsigned mask ) if( ::_controlfp_s( 0, old_cw | mask, BOOST_FPE_ALL ) != 0 ) return BOOST_FPE_INV; #endif - return ~old_cw & BOOST_FPE_ALL; -#elif defined(__GLIBC__) && defined(__USE_GNU) + +#elif defined(BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__) if (BOOST_FPE_ALL == BOOST_FPE_OFF) /* Not Implemented */ return BOOST_FPE_INV; |