diff --git a/include/boost/smart_ptr/detail/atomic_count.hpp b/include/boost/smart_ptr/detail/atomic_count.hpp index e0cbe26..456b2db 100644 --- a/include/boost/smart_ptr/detail/atomic_count.hpp +++ b/include/boost/smart_ptr/detail/atomic_count.hpp @@ -76,12 +76,12 @@ #elif !defined( BOOST_NO_CXX11_HDR_ATOMIC ) # include -#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined( __PATHSCALE__ ) -# include - #elif defined( BOOST_SP_HAS_SYNC_INTRINSICS ) # include +#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined( __PATHSCALE__ ) +# include + #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # include diff --git a/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp b/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp index 100c9cf..30a73e3 100644 --- a/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp @@ -13,6 +13,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include + #if defined(BOOST_SP_REPORT_IMPLEMENTATION) #include @@ -20,6 +22,8 @@ BOOST_PRAGMA_MESSAGE("Using g++/x86 atomic_count") #endif +BOOST_SP_OBSOLETE() + namespace boost { diff --git a/include/boost/smart_ptr/detail/atomic_count_sync.hpp b/include/boost/smart_ptr/detail/atomic_count_sync.hpp index 81d7d65..c65d1e9 100644 --- a/include/boost/smart_ptr/detail/atomic_count_sync.hpp +++ b/include/boost/smart_ptr/detail/atomic_count_sync.hpp @@ -15,6 +15,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include + #if defined( __ia64__ ) && defined( __INTEL_COMPILER ) # include #endif @@ -36,7 +38,9 @@ class atomic_count { public: - explicit atomic_count( long v ) : value_( v ) {} + explicit atomic_count( long v ) : value_( static_cast< boost::int_least32_t >( v ) ) + { + } long operator++() { @@ -58,7 +62,7 @@ private: atomic_count(atomic_count const &); atomic_count & operator=(atomic_count const &); - mutable long value_; + mutable boost::int_least32_t value_; }; } // namespace detail