From 17bb3a76bced244175360f014bf902c945fdc9d7 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Mar 03 2012 18:46:26 +0000 Subject: Fix compilation failure when including interlocked.hpp in c++11 mode (RHBZ #799332) --- diff --git a/changeset_75396.diff b/changeset_75396.diff new file mode 100644 index 0000000..cc7ca87 --- /dev/null +++ b/changeset_75396.diff @@ -0,0 +1,36 @@ +Index: trunk/boost/detail/interlocked.hpp +=================================================================== +--- trunk/boost/detail/interlocked.hpp (revision 70383) ++++ trunk/boost/detail/interlocked.hpp (revision 75396) +@@ -55,5 +55,9 @@ + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) + +-#if defined( __CLRCALL_PURE_OR_CDECL ) ++#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600 ++ ++#include ++ ++#elif defined( __CLRCALL_PURE_OR_CDECL ) + + extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * ); +@@ -120,13 +124,13 @@ + { + +-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 ); ++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* ); ++extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); ++extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); + # endif + diff --git a/mingw32-boost.spec b/mingw32-boost.spec index 008c608..e61468f 100644 --- a/mingw32-boost.spec +++ b/mingw32-boost.spec @@ -12,7 +12,7 @@ Version: 1.48.0 %define version_enc 1_48_0 %global dllboostver 1_48 %global dllgccver gcc47 -Release: 4%{?dist} +Release: 5%{?dist} Summary: MinGW Windows port of Boost C++ Libraries License: Boost @@ -72,6 +72,11 @@ Patch10: boost-1.48.0-mingw32.patch # instead of %{mingw32_libdir} Patch11: boost-install-dlls-to-bindir.patch +# Fix compilation when using c++11 mode +# https://bugzilla.redhat.com/show_bug.cgi?id=799332 +# https://svn.boost.org/trac/boost/changeset/75396 +Patch12: changeset_75396.diff + BuildArch: noarch BuildRequires: cmake @@ -128,6 +133,8 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH1} | %{__patch} -p0 --fuzz=0 %patch9 -p0 -b .gcc47wt %patch10 -p0 -b .mingw32 %patch11 -p0 -b .bindir +%patch12 -p1 -b .c++11 + %build # Support for building tests. @@ -448,6 +455,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Mar 3 2012 Erik van Pienbroek - 1.48.0-5 +- Fix compilation failure when including interlocked.hpp in c++11 mode (RHBZ #799332) + * Tue Feb 28 2012 Erik van Pienbroek - 1.48.0-4 - Rebuild against the mingw-w64 toolchain