121355d71e2f076ef1fc0742ecf614a7928ca541
[buildroot.git] /
1 From 32bd6197353f6ea8e5bef01f09e25c944141acfc Mon Sep 17 00:00:00 2001
2 From: jzmaddock <john@johnmaddock.co.uk>
3 Date: Wed, 1 Sep 2021 18:54:54 +0100
4 Subject: [PATCH] Allow definition of BOOST_MATH_NO_ATOMIC_INT on the command
5 line. Allows us to test/emulate platforms with no atomic integers.
6
7 ---
8 boost/math/tools/atomic.hpp | 10 +++++-----
9 1 file changed, 5 insertions(+), 5 deletions(-)
10
11 diff --git a/boost/math/tools/atomic.hpp b/boost/math/tools/atomic.hpp
12 index cc76ed269f..e3cbf5db89 100644
13 --- a/boost/math/tools/atomic.hpp
14 +++ b/boost/math/tools/atomic.hpp
15 @@ -16,27 +16,27 @@
16 namespace boost {
17 namespace math {
18 namespace detail {
19 -#if ATOMIC_INT_LOCK_FREE == 2
20 +#if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
21 typedef std::atomic<int> atomic_counter_type;
22 typedef std::atomic<unsigned> atomic_unsigned_type;
23 typedef int atomic_integer_type;
24 typedef unsigned atomic_unsigned_integer_type;
25 -#elif ATOMIC_SHORT_LOCK_FREE == 2
26 +#elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
27 typedef std::atomic<short> atomic_counter_type;
28 typedef std::atomic<unsigned short> atomic_unsigned_type;
29 typedef short atomic_integer_type;
30 typedef unsigned short atomic_unsigned_type;
31 -#elif ATOMIC_LONG_LOCK_FREE == 2
32 +#elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
33 typedef std::atomic<long> atomic_unsigned_integer_type;
34 typedef std::atomic<unsigned long> atomic_unsigned_type;
35 typedef unsigned long atomic_unsigned_type;
36 typedef long atomic_integer_type;
37 -#elif ATOMIC_LLONG_LOCK_FREE == 2
38 +#elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
39 typedef std::atomic<long long> atomic_unsigned_integer_type;
40 typedef std::atomic<unsigned long long> atomic_unsigned_type;
41 typedef long long atomic_integer_type;
42 typedef unsigned long long atomic_unsigned_integer_type;
43 -#else
44 +#elif !defined(BOOST_MATH_NO_ATOMIC_INT)
45 # define BOOST_MATH_NO_ATOMIC_INT
46 #endif
47 } // Namespace detail