summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/boost/boost/0002-math-allow-definition-of-boost_math_no_atomic_int-on-the-command-line.patch
blob: b05b79508443cb3959494f6397b673dc9b3b47af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 32bd6197353f6ea8e5bef01f09e25c944141acfc Mon Sep 17 00:00:00 2001
From: jzmaddock <john@johnmaddock.co.uk>
Date: Wed, 1 Sep 2021 18:54:54 +0100
Subject: [PATCH] Allow definition of BOOST_MATH_NO_ATOMIC_INT on the command
 line. Allows us to test/emulate platforms with no atomic integers.

[buildroot@heine.tech:
  - backport from boostorg/math 32bd6197353f6ea8e5bef01f09e25c944141acfc
  - alter path to match boost release
]
Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
Upstream-Status: Backport [https://github.com/boostorg/math/pull/684/commits/32bd6197353f6ea8e5bef01f09e25c944141acfc]
 boost/math/tools/atomic.hpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/boost/math/tools/atomic.hpp b/boost/math/tools/atomic.hpp
index cc76ed269f..e3cbf5db89 100644
--- a/boost/math/tools/atomic.hpp
+++ b/boost/math/tools/atomic.hpp
@@ -16,27 +16,27 @@
 namespace boost {
    namespace math {
       namespace detail {
-#if ATOMIC_INT_LOCK_FREE == 2
+#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
+#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
+#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
+#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;
-#else
+#elif !defined(BOOST_MATH_NO_ATOMIC_INT)
 #  define BOOST_MATH_NO_ATOMIC_INT
 #endif
       } // Namespace detail