Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51640 - in trunk: boost/signals2/detail libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-03-07 11:44:28


Author: fmhess
Date: 2009-03-07 11:44:27 EST (Sat, 07 Mar 2009)
New Revision: 51640
URL: http://svn.boost.org/trac/boost/changeset/51640

Log:
Finally fixed some odd test errors on msvc9.

Text files modified:
   trunk/boost/signals2/detail/lwm_win32_cs.hpp | 2 +-
   trunk/libs/signals2/test/mutex_test.cpp | 8 ++++++--
   trunk/libs/signals2/test/threading_models_test.cpp | 4 ++++
   3 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/boost/signals2/detail/lwm_win32_cs.hpp
==============================================================================
--- trunk/boost/signals2/detail/lwm_win32_cs.hpp (original)
+++ trunk/boost/signals2/detail/lwm_win32_cs.hpp 2009-03-07 11:44:27 EST (Sat, 07 Mar 2009)
@@ -84,7 +84,7 @@
         EnterCriticalSection(&cs_);
     }
 // TryEnterCriticalSection only exists on Windows NT 4.0 and later
-#if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)) || (defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN2K)
+#if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400))
     bool try_lock()
     {
         return TryEnterCriticalSection(&cs_) != 0;

Modified: trunk/libs/signals2/test/mutex_test.cpp
==============================================================================
--- trunk/libs/signals2/test/mutex_test.cpp (original)
+++ trunk/libs/signals2/test/mutex_test.cpp 2009-03-07 11:44:27 EST (Sat, 07 Mar 2009)
@@ -12,10 +12,14 @@
 // added to test boost::signals2::mutex.
 // For more information, see http://www.boost.org
 
+// note boost/test/minimal.hpp can cause windows.h to get included, which
+// can screw up our checks of _WIN32_WINNT if it is included
+// after boost/signals2/mutex.hpp. Frank Hess 2009-03-07.
+#include <boost/test/minimal.hpp>
+
 #include <boost/bind.hpp>
 #include <boost/signals2/dummy_mutex.hpp>
 #include <boost/signals2/mutex.hpp>
-#include <boost/test/minimal.hpp>
 #include <boost/thread/locks.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/thread.hpp>
@@ -267,7 +271,7 @@
 {
     test_lock<boost::signals2::mutex>()();
 // try_lock not supported on old versions of windows
-#if !defined(BOOST_HAS_WINTHREADS) || (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)) || (defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN2K)
+#if !defined(BOOST_HAS_WINTHREADS) || (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400))
     test_trylock<boost::signals2::mutex>()();
 #endif
     test_lock_exclusion<boost::signals2::mutex>()();

Modified: trunk/libs/signals2/test/threading_models_test.cpp
==============================================================================
--- trunk/libs/signals2/test/threading_models_test.cpp (original)
+++ trunk/libs/signals2/test/threading_models_test.cpp 2009-03-07 11:44:27 EST (Sat, 07 Mar 2009)
@@ -9,7 +9,11 @@
 
 // For more information, see http://www.boost.org
 
+// note boost/test/minimal.hpp can cause windows.h to get included, which
+// can screw up our checks of _WIN32_WINNT if it is included
+// after boost/signals2/mutex.hpp. Frank Hess 2009-03-07.
 #include <boost/test/minimal.hpp>
+
 #include <boost/signals2.hpp>
 #include <boost/thread/mutex.hpp>
 


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