Boost logo

Boost Testing :

Subject: Re: [Boost-testing] [daw-msvc71] something's amiss
From: David Walthall (walthall_at_[hidden])
Date: 2010-06-14 19:57:40


On 6/3/2010 11:16 AM, Eric Niebler wrote:
> Lots of test failures on daw-msvc71 that look like a misconfiguration,
> or at least a problem with Boost.Test on this platform. See
> http://tinyurl.com/yg5wgw5. This is the only tester for msvc-7.1 on
> trunk; it'd be great to get this resolved.
>

Hi Eric,

Thanks for the resend of this. I missed it the first time. Here were
the changes that I made to my local copy of execution_monitor.ipp to get
the .cpp to compile. I made some intelligent guesses as to what the vc
7.1 versions of _controlfp_s (_controlfp) should be, but they should be
checked carefully.

David

Index: C:/boost_testing_trunk/boost/boost/test/impl/execution_monitor.ipp
===================================================================
--- C:/boost_testing_trunk/boost/boost/test/impl/execution_monitor.ipp
(revision 62925)
+++ C:/boost_testing_trunk/boost/boost/test/impl/execution_monitor.ipp
(working copy)
@@ -861,15 +861,12 @@
 //____________________________________________________________________________//

 #if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
-static void
-seh_catch_preventer( unsigned int /* id */, _EXCEPTION_POINTERS* /*
exps */ )
-{
- throw;
-}
+extern "C" void seh_catch_preventer( unsigned int /* id */,
_EXCEPTION_POINTERS* /* exps */ );
 #endif

 //____________________________________________________________________________//

+
 int
 system_signal_exception::operator()( unsigned int id,
_EXCEPTION_POINTERS* exps )
 {
@@ -1070,6 +1067,15 @@
 // ************** execution_monitor::catch_signals
************** //
 //
**************************************************************************
//

+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
+extern "C" void seh_catch_preventer( unsigned int /* id */,
_EXCEPTION_POINTERS* /* exps */ )
+{
+ throw;
+}
+#endif
+
+//____________________________________________________________________________//
+
 int
 execution_monitor::catch_signals( unit_test::callback0<int> const& F )
 {
@@ -1323,13 +1329,21 @@
 #elif defined(BOOST_SEH_BASED_SIGNAL_HANDLING)
     _clearfp();

+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
+ unsigned old_cw = ::_controlfp( 0, 0 );
+#else
     unsigned old_cw;
     if( ::_controlfp_s( &old_cw, 0, 0 ) != 0 )
                 return BOOST_FPE_INV;
+#endif

     // Set the control word
+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
+ ::_controlfp( old_cw & ~mask, BOOST_FPE_ALL );
+#else
     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)
@@ -1353,13 +1367,21 @@
 #elif defined(BOOST_SEH_BASED_SIGNAL_HANDLING)
     _clearfp();

+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
+ unsigned old_cw = ::_controlfp( 0, 0 );
+#else
     unsigned old_cw;
     if( ::_controlfp_s( &old_cw, 0, 0 ) != 0 )
                 return BOOST_FPE_INV;
+#endif

+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1310)
+ ::_controlfp( old_cw | mask, BOOST_FPE_ALL );
+#else
     // Set the control word
     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)


Boost-testing list run by mbergal at meta-comm.com