aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Chisnall <dchisnall@pathscale.com>2014-05-09 01:35:33 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-09 01:35:33 +0000
commit50a4036f8968bc7798e5be2b90f9623257ebf155 (patch)
treea26773be4ef1958fee957bc65c334d0a52d1090a
parent7b2f8b5d8844d99784cc4f638435889a871dc3da (diff)
parentc812a07cd2f95c1403baf0bbe0366e7618d1d6d3 (diff)
downloadlibcxxrt-50a4036f8968bc7798e5be2b90f9623257ebf155.tar.gz
am c812a07c: Merge in fixes from FreeBSD trunk to make atomics work with recent clang.
* commit 'c812a07cd2f95c1403baf0bbe0366e7618d1d6d3': Merge in fixes from FreeBSD trunk to make atomics work with recent clang.
-rw-r--r--src/atomic.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/atomic.h b/src/atomic.h
index bcd8a47..f68faf3 100644
--- a/src/atomic.h
+++ b/src/atomic.h
@@ -9,9 +9,9 @@
* Swap macro that enforces a happens-before relationship with a corresponding
* ATOMIC_LOAD.
*/
-#if __has_feature(cxx_atomic)
+#if __has_builtin(__c11_atomic_exchange)
#define ATOMIC_SWAP(addr, val)\
- __atomic_exchange(addr, val, __ATOMIC_ACQ_REL)
+ __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL)
#elif __has_builtin(__sync_swap)
#define ATOMIC_SWAP(addr, val)\
__sync_swap(addr, val)
@@ -20,9 +20,9 @@
__sync_lock_test_and_set(addr, val)
#endif
-#if __has_feature(cxx_atomic)
+#if __has_builtin(__c11_atomic_load)
#define ATOMIC_LOAD(addr)\
- __atomic_load(addr, __ATOMIC_ACQUIRE)
+ __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE)
#else
#define ATOMIC_LOAD(addr)\
(__sync_synchronize(), *addr)