From 5dabdf635c9a880b7b8aaab44fd122054b5f5cfd Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Mon, 21 Mar 2011 23:09:07 +0000 Subject: [PATCH] Applied patch from issue #4849 [SVN r70383] --- include/boost/detail/interlocked.hpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index c88d326..5889ccb 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -106,21 +106,28 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); #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