]> code.ossystems Code Review - openembedded-core.git/blob
b05b79508443cb3959494f6397b673dc9b3b47af
[openembedded-core.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 [buildroot@heine.tech:
8   - backport from boostorg/math 32bd6197353f6ea8e5bef01f09e25c944141acfc
9   - alter path to match boost release
10 ]
11 Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
12 ---
13 Upstream-Status: Backport [https://github.com/boostorg/math/pull/684/commits/32bd6197353f6ea8e5bef01f09e25c944141acfc]
14  boost/math/tools/atomic.hpp | 10 +++++-----
15  1 file changed, 5 insertions(+), 5 deletions(-)
16
17 diff --git a/boost/math/tools/atomic.hpp b/boost/math/tools/atomic.hpp
18 index cc76ed269f..e3cbf5db89 100644
19 --- a/boost/math/tools/atomic.hpp
20 +++ b/boost/math/tools/atomic.hpp
21 @@ -16,27 +16,27 @@
22  namespace boost {
23     namespace math {
24        namespace detail {
25 -#if ATOMIC_INT_LOCK_FREE == 2
26 +#if (ATOMIC_INT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
27           typedef std::atomic<int> atomic_counter_type;
28           typedef std::atomic<unsigned> atomic_unsigned_type;
29           typedef int atomic_integer_type;
30           typedef unsigned atomic_unsigned_integer_type;
31 -#elif ATOMIC_SHORT_LOCK_FREE == 2
32 +#elif (ATOMIC_SHORT_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
33           typedef std::atomic<short> atomic_counter_type;
34           typedef std::atomic<unsigned short> atomic_unsigned_type;
35           typedef short atomic_integer_type;
36           typedef unsigned short atomic_unsigned_type;
37 -#elif ATOMIC_LONG_LOCK_FREE == 2
38 +#elif (ATOMIC_LONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
39           typedef std::atomic<long> atomic_unsigned_integer_type;
40           typedef std::atomic<unsigned long> atomic_unsigned_type;
41           typedef unsigned long atomic_unsigned_type;
42           typedef long atomic_integer_type;
43 -#elif ATOMIC_LLONG_LOCK_FREE == 2
44 +#elif (ATOMIC_LLONG_LOCK_FREE == 2) && !defined(BOOST_MATH_NO_ATOMIC_INT)
45           typedef std::atomic<long long> atomic_unsigned_integer_type;
46           typedef std::atomic<unsigned long long> atomic_unsigned_type;
47           typedef long long atomic_integer_type;
48           typedef unsigned long long atomic_unsigned_integer_type;
49 -#else
50 +#elif !defined(BOOST_MATH_NO_ATOMIC_INT)
51  #  define BOOST_MATH_NO_ATOMIC_INT
52  #endif
53        } // Namespace detail