Merge pull request #6182 from hack3ric/master

Fix CheckAtomic.cmake
This commit is contained in:
Dennis Felsing 2022-12-25 01:28:16 +01:00 committed by GitHub
commit 8d1c6ae1e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,11 +10,16 @@ function(check_working_cxx_atomics varname)
check_cxx_source_compiles("
#include <atomic>
#include <cstdint>
std::atomic<int> x1;
std::atomic<short> x2;
std::atomic<char> x3;
std::atomic<uint64_t> x (0);
int main() {
uint64_t i = x.load(std::memory_order_relaxed);
(void)i;
return 0;
++x3;
++x2;
return ++x1;
}
" ${varname})
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})