Ticket #4849: mingw64-thread-2.patch

File mingw64-thread-2.patch, 3.4 KB (added by Jim Bell <jim@…>, 12 years ago)
  • boost/detail/interlocked.hpp

     
    106106
    107107#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
    108108
     109#if defined(__MINGW64__)
     110#define BOOST_INTERLOCKED_IMPORT
     111#else
     112#define BOOST_INTERLOCKED_IMPORT        __declspec(dllimport)
     113#endif
     114
     115
    109116namespace boost
    110117{
    111118
    112119namespace detail
    113120{
    114121
    115 extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
    116 extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
    117 extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
    118 extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
    119 extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
     122extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
     123extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
     124extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
     125extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
     126extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
    120127
    121128# if defined(_M_IA64) || defined(_M_AMD64)
    122 extern "C" __declspec(dllimport) void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
    123 extern "C" __declspec(dllimport) void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
     129extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
     130extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
    124131# endif
    125132
    126133} // namespace detail
  • libs/thread/src/win32/thread.cpp

     
    99
    1010#include <boost/thread/thread.hpp>
    1111#include <algorithm>
    12 #include <windows.h>
    1312#ifndef UNDER_CE
    1413#include <process.h>
    1514#endif
     
    2019#include <boost/throw_exception.hpp>
    2120#include <boost/thread/detail/tss_hooks.hpp>
    2221#include <boost/date_time/posix_time/conversion.hpp>
     22#include <windows.h>
    2323
    2424namespace boost
    2525{
  • libs/thread/src/win32/tss_pe.cpp

     
    1111
    1212#if defined(BOOST_HAS_WINTHREADS) && defined(BOOST_THREAD_BUILD_LIB)
    1313
    14 #if defined(__MINGW32__) && !defined(_WIN64)
     14#if (defined(__MINGW32__) && !defined(_WIN64)) || defined(__MINGW64__)
    1515
    1616#include <boost/thread/detail/tss_hooks.hpp>
    1717
     
    3838    }
    3939}
    4040
    41 #if (__MINGW32_MAJOR_VERSION >3) || ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))
     41#if defined(__MINGW64__) || (__MINGW32_MAJOR_VERSION >3) || ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))
    4242extern "C"
    4343{
    4444    PIMAGE_TLS_CALLBACK __crt_xl_tls_callback__ __attribute__ ((section(".CRT$XLB"))) = on_tls_callback;