diff --git a/Source/Core/Common/Atomic_GCC.h b/Source/Core/Common/Atomic_GCC.h index f06628037f..f4ffb0f631 100644 --- a/Source/Core/Common/Atomic_GCC.h +++ b/Source/Core/Common/Atomic_GCC.h @@ -45,7 +45,8 @@ inline void AtomicOr(volatile u32& target, u32 value) { __sync_or_and_fetch(&target, value); } -#ifdef __clang__ +// Support clang versions older than 3.4. +#if __clang__ && !__has_feature(cxx_atomic) template _Atomic(T)* ToC11Atomic(volatile T* loc) { diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h index 1f600926ff..8605d97929 100644 --- a/Source/Core/Common/Common.h +++ b/Source/Core/Common/Common.h @@ -11,6 +11,10 @@ #include #include +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + // SVN version number extern const char *scm_desc_str; extern const char *scm_branch_str;