File indexing completed on 2025-01-18 09:39:17
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_LOCKFREE_DETAIL_ATOMIC_HPP
0008 #define BOOST_LOCKFREE_DETAIL_ATOMIC_HPP
0009
0010 #include <boost/config.hpp>
0011
0012 #ifndef BOOST_LOCKFREE_FORCE_STD_ATOMIC
0013
0014 #define BOOST_LOCKFREE_NO_HDR_ATOMIC
0015
0016
0017 #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
0018 #undef BOOST_LOCKFREE_NO_HDR_ATOMIC
0019 #endif
0020
0021
0022
0023 #if (BOOST_GCC >= 40800) && (__cplusplus >= 201103L)
0024 #undef BOOST_LOCKFREE_NO_HDR_ATOMIC
0025 #endif
0026
0027
0028
0029 #ifdef BOOST_CLANG
0030
0031 #define BOOST_ATOMIC_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
0032
0033 #if defined(__apple_build_version__) && (BOOST_ATOMIC_CLANG_VERSION >= 60100) && (__cplusplus >= 201103L)
0034 #undef BOOST_LOCKFREE_NO_HDR_ATOMIC
0035 #endif
0036
0037 #if !defined(__apple_build_version__) && (BOOST_ATOMIC_CLANG_VERSION >= 30600) && (__cplusplus >= 201103L)
0038 #undef BOOST_LOCKFREE_NO_HDR_ATOMIC
0039 #endif
0040
0041 #undef BOOST_ATOMIC_CLANG_VERSION
0042
0043 #endif
0044
0045
0046 #include <boost/config.hpp>
0047 #if defined(BOOST_NO_CXX11_HDR_ATOMIC) && !defined(BOOST_LOCKFREE_NO_HDR_ATOMIC)
0048 # define BOOST_LOCKFREE_NO_HDR_ATOMIC
0049 #endif
0050
0051 #endif
0052
0053
0054 #if defined(BOOST_LOCKFREE_NO_HDR_ATOMIC) || defined(BOOST_LOCKFREE_FORCE_BOOST_ATOMIC)
0055 #include <boost/atomic.hpp>
0056 #else
0057 #include <atomic>
0058 #endif
0059
0060 namespace boost {
0061 namespace lockfree {
0062 namespace detail {
0063
0064 #if defined(BOOST_LOCKFREE_NO_HDR_ATOMIC) || defined(BOOST_LOCKFREE_FORCE_BOOST_ATOMIC)
0065 using boost::atomic;
0066 using boost::memory_order_acquire;
0067 using boost::memory_order_consume;
0068 using boost::memory_order_relaxed;
0069 using boost::memory_order_release;
0070 #else
0071 using std::atomic;
0072 using std::memory_order_acquire;
0073 using std::memory_order_consume;
0074 using std::memory_order_relaxed;
0075 using std::memory_order_release;
0076 #endif
0077
0078 }
0079 using detail::atomic;
0080 using detail::memory_order_acquire;
0081 using detail::memory_order_consume;
0082 using detail::memory_order_relaxed;
0083 using detail::memory_order_release;
0084
0085 }}
0086
0087 #endif