summaryrefslogtreecommitdiffstats
path: root/debian/patches/fix-CheckCxxAtomic-riscv64.patch
blob: 52d3ad7f3ee485f4ec2ab0c3ef6b81007163a48a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Fix CheckCxxAtomic to detect more accurately
 Some platforms like riscv64 does not have full support for atomic primitives,
 yet passes the test. Adding operator++ fixes this issue.
Author: Eric Long <i@hack3r.moe>
Last-Update: 2022-08-30
--- a/cmake/modules/CheckCxxAtomic.cmake
+++ b/cmake/modules/CheckCxxAtomic.cmake
@@ -32,7 +32,7 @@
   std::atomic<uint16_t> w2;
   std::atomic<uint32_t> w4;
   std::atomic<uint64_t> w8;
-  return w1 + w2 + w4 + w8;
+  return ++w1 + ++w2 + ++w4 + ++w8;
 }
 " ${var})
 endfunction(check_cxx_atomics)