|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72657 - branches/release/boost/detail
From: anthony_at_[hidden]
Date: 2011-06-17 17:01:47
Author: anthonyw
Date: 2011-06-17 17:01:46 EDT (Fri, 17 Jun 2011)
New Revision: 72657
URL: http://svn.boost.org/trac/boost/changeset/72657
Log:
Merged fix for issue #4849 from trunk (fix boost.thread on mingw64) (authorized by rene)
Properties modified:
branches/release/boost/detail/interlocked.hpp (contents, props changed)
Text files modified:
branches/release/boost/detail/interlocked.hpp | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
Modified: branches/release/boost/detail/interlocked.hpp
==============================================================================
--- branches/release/boost/detail/interlocked.hpp (original)
+++ branches/release/boost/detail/interlocked.hpp 2011-06-17 17:01:46 EDT (Fri, 17 Jun 2011)
@@ -106,17 +106,29 @@
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
+#if defined(__MINGW64__)
+#define BOOST_INTERLOCKED_IMPORT
+#else
+#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
+#endif
+
+
namespace boost
{
namespace detail
{
-extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
-extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
-extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
-extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
-extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
+
+# if defined(_M_IA64) || defined(_M_AMD64)
+extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
+extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
+# endif
} // namespace detail
@@ -128,10 +140,15 @@
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
-# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
+# if defined(_M_IA64) || defined(_M_AMD64)
+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
+# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer
+# else
+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
-# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
+# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
+# endif
#else
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