Atomic: support clang 3.4+

This commit is contained in:
Tillmann Karras 2014-04-17 10:39:02 +02:00
parent 0908bd64dc
commit b3c7395a23
2 changed files with 6 additions and 1 deletions

View File

@ -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 <typename T>
_Atomic(T)* ToC11Atomic(volatile T* loc)
{

View File

@ -11,6 +11,10 @@
#include <cstdlib>
#include <cstring>
#ifndef __has_feature
#define __has_feature(x) 0
#endif
// SVN version number
extern const char *scm_desc_str;
extern const char *scm_branch_str;