Fix compilation on gcc before 4.7 due to use of atomic builtins.

This commit is contained in:
Jonathan G Rennison
2016-01-07 22:45:11 +00:00
parent c3948ef5e9
commit 548ea31e83
2 changed files with 2 additions and 2 deletions

View File

@@ -179,7 +179,7 @@ LinkGraphJob::~LinkGraphJob()
*/ */
bool LinkGraphJob::IsJobCompleted() const bool LinkGraphJob::IsJobCompleted() const
{ {
#if defined(__GNUC__) && (__cplusplus >= 201103L || defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
return __atomic_load_n(&job_completed, __ATOMIC_RELAXED); return __atomic_load_n(&job_completed, __ATOMIC_RELAXED);
#else #else
return job_completed; return job_completed;

View File

@@ -99,7 +99,7 @@ void LinkGraphSchedule::JoinNext()
* This is just a hint variable to avoid performing the join excessively early and blocking the main thread. * This is just a hint variable to avoid performing the join excessively early and blocking the main thread.
*/ */
#if defined(__GNUC__) && (__cplusplus >= 201103L || defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
__atomic_store_n(&(job->job_completed), true, __ATOMIC_RELAXED); __atomic_store_n(&(job->job_completed), true, __ATOMIC_RELAXED);
#else #else
job->job_completed = true; job->job_completed = true;