Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/smart_ptr/detail/atomic_count_win32.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | c530137014c0 |
children |
rev | line source |
---|---|
Chris@16 | 1 #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED |
Chris@16 | 2 #define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED |
Chris@16 | 3 |
Chris@16 | 4 // MS compatible compilers support #pragma once |
Chris@16 | 5 |
Chris@16 | 6 #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
Chris@16 | 7 # pragma once |
Chris@16 | 8 #endif |
Chris@16 | 9 |
Chris@16 | 10 // |
Chris@16 | 11 // boost/detail/atomic_count_win32.hpp |
Chris@16 | 12 // |
Chris@16 | 13 // Copyright (c) 2001-2005 Peter Dimov |
Chris@16 | 14 // |
Chris@16 | 15 // Distributed under the Boost Software License, Version 1.0. (See |
Chris@16 | 16 // accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 17 // http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 18 // |
Chris@16 | 19 |
Chris@101 | 20 #include <boost/smart_ptr/detail/sp_interlocked.hpp> |
Chris@16 | 21 |
Chris@16 | 22 namespace boost |
Chris@16 | 23 { |
Chris@16 | 24 |
Chris@16 | 25 namespace detail |
Chris@16 | 26 { |
Chris@16 | 27 |
Chris@16 | 28 class atomic_count |
Chris@16 | 29 { |
Chris@16 | 30 public: |
Chris@16 | 31 |
Chris@16 | 32 explicit atomic_count( long v ): value_( v ) |
Chris@16 | 33 { |
Chris@16 | 34 } |
Chris@16 | 35 |
Chris@16 | 36 long operator++() |
Chris@16 | 37 { |
Chris@101 | 38 return BOOST_SP_INTERLOCKED_INCREMENT( &value_ ); |
Chris@16 | 39 } |
Chris@16 | 40 |
Chris@16 | 41 long operator--() |
Chris@16 | 42 { |
Chris@101 | 43 return BOOST_SP_INTERLOCKED_DECREMENT( &value_ ); |
Chris@16 | 44 } |
Chris@16 | 45 |
Chris@16 | 46 operator long() const |
Chris@16 | 47 { |
Chris@16 | 48 return static_cast<long const volatile &>( value_ ); |
Chris@16 | 49 } |
Chris@16 | 50 |
Chris@16 | 51 private: |
Chris@16 | 52 |
Chris@16 | 53 atomic_count( atomic_count const & ); |
Chris@16 | 54 atomic_count & operator=( atomic_count const & ); |
Chris@16 | 55 |
Chris@16 | 56 long value_; |
Chris@16 | 57 }; |
Chris@16 | 58 |
Chris@16 | 59 } // namespace detail |
Chris@16 | 60 |
Chris@16 | 61 } // namespace boost |
Chris@16 | 62 |
Chris@16 | 63 #endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED |