1 #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 // boost/detail/atomic_count_win32.hpp
13 // Copyright (c) 2001-2005 Peter Dimov
15 // Distributed under the Boost Software License, Version 1.0. (See
16 // accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
20 #include <boost/smart_ptr/detail/sp_interlocked.hpp>
22 #if defined(BOOST_SP_REPORT_IMPLEMENTATION)
24 #include <boost/config/pragma_message.hpp>
25 BOOST_PRAGMA_MESSAGE("Using Win32 atomic_count")
39 explicit atomic_count( long v ): value_( v )
45 return BOOST_SP_INTERLOCKED_INCREMENT( &value_ );
50 return BOOST_SP_INTERLOCKED_DECREMENT( &value_ );
55 return static_cast<long const volatile &>( value_ );
60 atomic_count( atomic_count const & );
61 atomic_count & operator=( atomic_count const & );
70 #endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED