From 7438aea8697802595dc5faf662606317b75f995c Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sun, 23 Oct 2011 23:27:38 +0200 Subject: [PATCH] Fix SGAtomic mutex logic. --- simgear/structure/SGAtomic.cxx | 4 +++- simgear/structure/SGAtomic.hxx | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/simgear/structure/SGAtomic.cxx b/simgear/structure/SGAtomic.cxx index 68fcf775..71f24ed9 100644 --- a/simgear/structure/SGAtomic.cxx +++ b/simgear/structure/SGAtomic.cxx @@ -30,8 +30,10 @@ # include #elif defined(GCC_ATOMIC_BUILTINS_FOUND) #elif defined(__GNUC__) && defined(__i386__) -#else +#elif defined(SGATOMIC_USE_MUTEX) # include +#else +# error #endif unsigned diff --git a/simgear/structure/SGAtomic.hxx b/simgear/structure/SGAtomic.hxx index 91bb262e..493c8d25 100644 --- a/simgear/structure/SGAtomic.hxx +++ b/simgear/structure/SGAtomic.hxx @@ -35,6 +35,7 @@ #else // The sledge hammer ... # define SGATOMIC_USE_LIBRARY_FUNCTIONS +# define SGATOMIC_USE_MUTEX # include #endif @@ -109,9 +110,7 @@ private: SGAtomic(const SGAtomic&); SGAtomic& operator=(const SGAtomic&); -#if !defined(SGATOMIC_USE_GCC4_BUILTINS) \ - && !defined(SGATOMIC_USE_MIPOSPRO_BUILTINS) \ - && !defined(SGATOMIC_USE_WIN32_INTERLOCKED) +#if defined(SGATOMIC_USE_MUTEX) mutable SGMutex mMutex; #endif unsigned mValue; -- 2.39.5