Fix CheckCxxAtomic to detect more accurately
authorEric Long <i@hack3r.moe>
Thu, 16 Feb 2023 10:54:41 +0000 (10:54 +0000)
committerThomas Goirand <zigo@debian.org>
Thu, 16 Feb 2023 10:54:41 +0000 (10:54 +0000)
Last-Update: 2022-08-30

Some platforms like riscv64 does not have full support for atomic primitives,
yet passes the test. Adding operator++ fixes this issue.

Gbp-Pq: Name fix-CheckCxxAtomic-riscv64.patch

cmake/modules/CheckCxxAtomic.cmake

index 833977b758b24fc6748a622595386e0970cf5012..5510193a6d253ce6635fddeba5add26531a91439 100644 (file)
@@ -32,7 +32,7 @@ int main() {
   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)