Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63576 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2010-07-04 03:28:21


Author: chris_kohlhoff
Date: 2010-07-04 03:28:20 EDT (Sun, 04 Jul 2010)
New Revision: 63576
URL: http://svn.boost.org/trac/boost/changeset/63576

Log:
Make more tolerant of different platform sdk variants.

Text files modified:
   trunk/boost/asio/detail/win_fenced_block.hpp | 26 ++++++++++++--------------
   1 files changed, 12 insertions(+), 14 deletions(-)

Modified: trunk/boost/asio/detail/win_fenced_block.hpp
==============================================================================
--- trunk/boost/asio/detail/win_fenced_block.hpp (original)
+++ trunk/boost/asio/detail/win_fenced_block.hpp 2010-07-04 03:28:20 EDT (Sun, 04 Jul 2010)
@@ -34,7 +34,10 @@
   // Constructor.
   win_fenced_block()
   {
-#if defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+#if defined(__BORLANDC__)
+ LONG barrier = 0;
+ ::InterlockedExchange(&barrier, 1);
+#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -42,15 +45,18 @@
     __asm { xchg barrier, eax }
 # pragma warning(pop)
 # endif // defined(_M_IX86)
-#else // defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+#else
     MemoryBarrier();
-#endif // defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+#endif
   }
 
   // Destructor.
   ~win_fenced_block()
   {
-#if defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+#if defined(__BORLANDC__)
+ LONG barrier = 0;
+ ::InterlockedExchange(&barrier, 1);
+#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -58,18 +64,10 @@
     __asm { xchg barrier, eax }
 # pragma warning(pop)
 # endif // defined(_M_IX86)
-#else // defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
+#else
     MemoryBarrier();
-#endif // defined(BOOST_MSVC) && (BOOST_MSVC < 1400)
- }
-
-#if defined(__BORLANDC__)
- static void MemoryBarrier()
- {
- LONG barrier = 0;
- ::InterlockedExchange(&barrier, 1);
+#endif
   }
-#endif // defined(__BORLANDC__)
 };
 
 } // namespace detail


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