1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef BOOST_MATH_ATOMIC_DETAIL_HPP
- #define BOOST_MATH_ATOMIC_DETAIL_HPP
- #include <boost/math/tools/config.hpp>
- #include <boost/math/tools/cxx03_warn.hpp>
- #ifdef BOOST_MATH_HAS_THREADS
- #include <atomic>
- namespace boost {
- namespace math {
- namespace detail {
- #if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
- typedef std::atomic<int> atomic_counter_type;
- typedef std::atomic<unsigned> atomic_unsigned_type;
- typedef int atomic_integer_type;
- typedef unsigned atomic_unsigned_integer_type;
- #elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
- typedef std::atomic<short> atomic_counter_type;
- typedef std::atomic<unsigned short> atomic_unsigned_type;
- typedef short atomic_integer_type;
- typedef unsigned short atomic_unsigned_type;
- #elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
- typedef std::atomic<long> atomic_unsigned_integer_type;
- typedef std::atomic<unsigned long> atomic_unsigned_type;
- typedef unsigned long atomic_unsigned_type;
- typedef long atomic_integer_type;
- #elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
- typedef std::atomic<long long> atomic_unsigned_integer_type;
- typedef std::atomic<unsigned long long> atomic_unsigned_type;
- typedef long long atomic_integer_type;
- typedef unsigned long long atomic_unsigned_integer_type;
- #elif !defined(BOOST_MATH_NO_ATOMIC_INT)
- # define BOOST_MATH_NO_ATOMIC_INT
- #endif
- }
- }
- }
- #else
- # define BOOST_MATH_NO_ATOMIC_INT
- #endif
- #endif
|