Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70383 - in trunk: boost/detail libs/thread/src/win32
From: anthony_at_[hidden]
Date: 2011-03-21 19:09:09


Author: anthonyw
Date: 2011-03-21 19:09:07 EDT (Mon, 21 Mar 2011)
New Revision: 70383
URL: http://svn.boost.org/trac/boost/changeset/70383

Log:
Applied patch from issue #4849
Text files modified:
   trunk/boost/detail/interlocked.hpp | 21 ++++++++++++++-------
   trunk/libs/thread/src/win32/thread.cpp | 2 +-
   trunk/libs/thread/src/win32/tss_pe.cpp | 5 +++--
   3 files changed, 18 insertions(+), 10 deletions(-)

Modified: trunk/boost/detail/interlocked.hpp
==============================================================================
--- trunk/boost/detail/interlocked.hpp (original)
+++ trunk/boost/detail/interlocked.hpp 2011-03-21 19:09:07 EDT (Mon, 21 Mar 2011)
@@ -106,21 +106,28 @@
 
 #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" __declspec(dllimport) void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
-extern "C" __declspec(dllimport) void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
+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

Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2011-03-21 19:09:07 EDT (Mon, 21 Mar 2011)
@@ -9,7 +9,6 @@
 
 #include <boost/thread/thread.hpp>
 #include <algorithm>
-#include <windows.h>
 #ifndef UNDER_CE
 #include <process.h>
 #endif
@@ -20,6 +19,7 @@
 #include <boost/throw_exception.hpp>
 #include <boost/thread/detail/tss_hooks.hpp>
 #include <boost/date_time/posix_time/conversion.hpp>
+#include <windows.h>
 
 namespace boost
 {

Modified: trunk/libs/thread/src/win32/tss_pe.cpp
==============================================================================
--- trunk/libs/thread/src/win32/tss_pe.cpp (original)
+++ trunk/libs/thread/src/win32/tss_pe.cpp 2011-03-21 19:09:07 EDT (Mon, 21 Mar 2011)
@@ -11,7 +11,7 @@
 
 #if defined(BOOST_HAS_WINTHREADS) && defined(BOOST_THREAD_BUILD_LIB)
 
-#if defined(__MINGW32__) && !defined(_WIN64)
+#if #if (defined(__MINGW32__) && !defined(_WIN64)) || defined(__MINGW64__)
 
 #include <boost/thread/detail/tss_hooks.hpp>
 
@@ -38,7 +38,8 @@
     }
 }
 
-#if (__MINGW32_MAJOR_VERSION >3) || ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))
+#if defined(__MINGW64__) || (__MINGW32_MAJOR_VERSION >3) || \
+ ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))
 extern "C"
 {
     PIMAGE_TLS_CALLBACK __crt_xl_tls_callback__ __attribute__ ((section(".CRT$XLB"))) = on_tls_callback;


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