From 1712b87cb6f95a371d0d95d4acbe16de2ee75a09 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 21 Jul 2015 15:41:35 -0400 Subject: [PATCH 1/4] Added __declspec(dllimport) for Sleep using clang on Windows. --- include/boost/smart_ptr/detail/yield_k.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/smart_ptr/detail/yield_k.hpp b/include/boost/smart_ptr/detail/yield_k.hpp index 2dabc9f..c3d0450 100644 --- a/include/boost/smart_ptr/detail/yield_k.hpp +++ b/include/boost/smart_ptr/detail/yield_k.hpp @@ -60,8 +60,12 @@ namespace detail { #if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME +#if BOOST_COMP_CLANG + extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms ); +#else extern "C" void __stdcall Sleep( unsigned long ms ); #endif +#endif inline void yield( unsigned k ) { From acb880d8c2c19864a6176da78aca0935b0eccb7d Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 22 Jul 2015 06:51:49 -0400 Subject: [PATCH 2/4] Change to Sleep declaration for clang on Windows to match Windows implementation being used --- include/boost/smart_ptr/detail/yield_k.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/smart_ptr/detail/yield_k.hpp b/include/boost/smart_ptr/detail/yield_k.hpp index c3d0450..5beefd6 100644 --- a/include/boost/smart_ptr/detail/yield_k.hpp +++ b/include/boost/smart_ptr/detail/yield_k.hpp @@ -27,6 +27,10 @@ #include #include +#if defined __MINGW32__ +#include <_mingw.h> +#endif + #if BOOST_PLAT_WINDOWS_RUNTIME #include #endif @@ -60,10 +64,10 @@ namespace detail { #if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME -#if BOOST_COMP_CLANG - extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms ); -#else +#if !BOOST_COMP_CLANG || (defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR) extern "C" void __stdcall Sleep( unsigned long ms ); +#else + extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms ); #endif #endif From 686efe100bcb8acb240d4eb6169a74f5014247ea Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 22 Jul 2015 18:23:43 -0400 Subject: [PATCH 3/4] Updated Sleep declaration only includes _mingw.h when needed. --- include/boost/smart_ptr/detail/yield_k.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/smart_ptr/detail/yield_k.hpp b/include/boost/smart_ptr/detail/yield_k.hpp index 5beefd6..44d1836 100644 --- a/include/boost/smart_ptr/detail/yield_k.hpp +++ b/include/boost/smart_ptr/detail/yield_k.hpp @@ -27,10 +27,6 @@ #include #include -#if defined __MINGW32__ -#include <_mingw.h> -#endif - #if BOOST_PLAT_WINDOWS_RUNTIME #include #endif @@ -64,12 +60,17 @@ namespace detail { #if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME -#if !BOOST_COMP_CLANG || (defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR) +#if !BOOST_COMP_CLANG || !defined __MINGW32__ + extern "C" void __stdcall Sleep( unsigned long ms ); +#else +#include <_mingw.h> +#if !defined __MINGW64_VERSION_MAJOR extern "C" void __stdcall Sleep( unsigned long ms ); #else extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms ); #endif #endif +#endif inline void yield( unsigned k ) { From abbe975e8fc8377460869d075f98abf1b0ff7913 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 18 Aug 2015 18:14:50 +0100 Subject: [PATCH 4/4] Disable explicit operator bool on Oracle C++ Although Oracle supports this syntax, advanced usage such as: if(my_shared_ptr && x) Fail. Attempts to wokaround by adding additional operator overloads have so far failed. --- include/boost/smart_ptr/detail/operator_bool.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/smart_ptr/detail/operator_bool.hpp b/include/boost/smart_ptr/detail/operator_bool.hpp index 8ae1527..c0289b8 100644 --- a/include/boost/smart_ptr/detail/operator_bool.hpp +++ b/include/boost/smart_ptr/detail/operator_bool.hpp @@ -6,7 +6,8 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR ) +#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR )\ + && !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5130)) explicit operator bool () const BOOST_NOEXCEPT {