Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:16

0001 ///////////////////////////////////////////////////////////////////////////////
0002 //  Copyright 2017 John Maddock
0003 //  Distributed under the Boost
0004 //  Software License, Version 1.0. (See accompanying file
0005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_MP_DETAIL_ATOMIC_HPP
0008 #define BOOST_MP_DETAIL_ATOMIC_HPP
0009 
0010 #include <boost/multiprecision/detail/standalone_config.hpp>
0011 
0012 #ifdef BOOST_HAS_THREADS
0013 
0014 #  include <atomic>
0015 #  define BOOST_MATH_ATOMIC_NS std
0016 namespace boost {
0017    namespace multiprecision {
0018       namespace detail {
0019 #if ATOMIC_INT_LOCK_FREE == 2
0020          using atomic_counter_type = std::atomic<int>;
0021          using atomic_unsigned_type = std::atomic<unsigned>;
0022          using atomic_integer_type = int;
0023          using atomic_unsigned_integer_type = unsigned;
0024 #elif ATOMIC_SHORT_LOCK_FREE == 2
0025          using atomic_counter_type = std::atomic<short>;
0026          using atomic_unsigned_type = std::atomic<unsigned short>;
0027          using atomic_integer_type = short;
0028          using atomic_unsigned_integer_type = unsigned short;
0029 #elif ATOMIC_LONG_LOCK_FREE == 2
0030          using atomic_unsigned_integer_type = std::atomic<long>;
0031          using atomic_unsigned_type = std::atomic<unsigned long>;
0032          using atomic_unsigned_integer_type = unsigned long;
0033          using atomic_integer_type = long;
0034 #elif ATOMIC_LLONG_LOCK_FREE == 2
0035          using atomic_unsigned_integer_type = std::atomic<long long>;
0036          using atomic_unsigned_type = std::atomic<unsigned long long>;
0037          using atomic_integer_type = long long;
0038          using atomic_unsigned_integer_type = unsigned long long;
0039 #else
0040 
0041 #define BOOST_MT_NO_ATOMIC_INT
0042 
0043 #endif
0044       }
0045    }}
0046 #else // BOOST_HAS_THREADS
0047 
0048 #define BOOST_MT_NO_ATOMIC_INT
0049 
0050 #endif // BOOST_HAS_THREADS
0051 
0052 namespace boost { namespace multiprecision { namespace detail {
0053 
0054 #ifdef BOOST_MT_NO_ATOMIC_INT
0055 using precision_type = unsigned;
0056 #else
0057 using precision_type = atomic_unsigned_type;
0058 #endif
0059 
0060 } } }
0061 
0062 #endif // BOOST_MP_DETAIL_ATOMIC_HPP