]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Copyright 2017 John Maddock | |
3 | // Distributed under the Boost | |
4 | // Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | #ifndef BOOST_MATH_ATOMIC_DETAIL_HPP | |
8 | #define BOOST_MATH_ATOMIC_DETAIL_HPP | |
9 | ||
1e59de90 | 10 | #include <boost/math/tools/config.hpp> |
f67539c2 | 11 | #include <boost/math/tools/cxx03_warn.hpp> |
b32b8144 FG |
12 | |
13 | #ifdef BOOST_HAS_THREADS | |
1e59de90 | 14 | #include <atomic> |
b32b8144 | 15 | |
b32b8144 FG |
16 | namespace boost { |
17 | namespace math { | |
18 | namespace detail { | |
1e59de90 | 19 | #if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT) |
b32b8144 FG |
20 | typedef std::atomic<int> atomic_counter_type; |
21 | typedef std::atomic<unsigned> atomic_unsigned_type; | |
22 | typedef int atomic_integer_type; | |
23 | typedef unsigned atomic_unsigned_integer_type; | |
1e59de90 | 24 | #elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT) |
b32b8144 FG |
25 | typedef std::atomic<short> atomic_counter_type; |
26 | typedef std::atomic<unsigned short> atomic_unsigned_type; | |
27 | typedef short atomic_integer_type; | |
28 | typedef unsigned short atomic_unsigned_type; | |
1e59de90 | 29 | #elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT) |
b32b8144 FG |
30 | typedef std::atomic<long> atomic_unsigned_integer_type; |
31 | typedef std::atomic<unsigned long> atomic_unsigned_type; | |
32 | typedef unsigned long atomic_unsigned_type; | |
33 | typedef long atomic_integer_type; | |
1e59de90 | 34 | #elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT) |
b32b8144 FG |
35 | typedef std::atomic<long long> atomic_unsigned_integer_type; |
36 | typedef std::atomic<unsigned long long> atomic_unsigned_type; | |
37 | typedef long long atomic_integer_type; | |
38 | typedef unsigned long long atomic_unsigned_integer_type; | |
1e59de90 | 39 | #elif !defined(BOOST_MATH_NO_ATOMIC_INT) |
b32b8144 FG |
40 | # define BOOST_MATH_NO_ATOMIC_INT |
41 | #endif | |
1e59de90 TL |
42 | } // Namespace detail |
43 | } // Namespace math | |
44 | } // Namespace boost | |
b32b8144 | 45 | |
b32b8144 FG |
46 | #else |
47 | # define BOOST_MATH_NO_ATOMIC_INT | |
b32b8144 FG |
48 | #endif // BOOST_HAS_THREADS |
49 | ||
50 | #endif // BOOST_MATH_ATOMIC_DETAIL_HPP |