From 4d19d4f416f39902f5bb08e822c262d571136aa6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 5 Sep 2014 17:47:32 -0700 Subject: Check that atomic_load works with a const _Atomic The original C11 spec does not allow atomic_load to work on const _Atomic variables, which we sometimes do in alGet* methods, despite the fact that it does not modify the variable. An update to the C spec corrects this oversight, and GCC 4.9 has allowed it anyway, while Clang 3.4 does not. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a66ea70a..c4d4286c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,7 +186,7 @@ HAVE_C11_ALIGNAS) # Check if we have C11 _Atomic CHECK_C_SOURCE_COMPILES( "#include - int _Atomic foo; + const int _Atomic foo = ATOMIC_VAR_INIT(~0); int main() { return atomic_load(&foo); -- cgit v1.2.3