diff -up qtractor-0.5.12/src/qtractorAtomic.h.secondary qtractor-0.5.12/src/qtractorAtomic.h --- qtractor-0.5.12/src/qtractorAtomic.h.secondary 2014-03-13 20:20:56.000000000 +0100 +++ qtractor-0.5.12/src/qtractorAtomic.h 2014-03-13 21:45:47.000000000 +0100 @@ -33,6 +33,27 @@ extern "C" { #endif + +#if defined(HAVE_QATOMIC_H) + +typedef QAtomicInt qtractorAtomic; + +#if QT_VERSION >= 0x050000 +#define ATOMIC_GET(a) ((a)->load()) +#define ATOMIC_SET(a,v) ((a)->store(v)) +#else +#define ATOMIC_GET(a) ((int) *(a)) +#define ATOMIC_SET(a,v) (*(a) = (v)) +#endif + +static inline int ATOMIC_CAS ( qtractorAtomic *pVal, + int iOldValue, int iNewValue ) +{ + return pVal->testAndSetOrdered(iOldValue, iNewValue); +} + +#else + #if defined(__GNUC__) #if defined(powerpc) || defined(__ppc__) @@ -106,27 +127,6 @@ static inline int ATOMIC_CAS1 ( # error "qtractorAtomic.h: unsupported target compiler processor (WIN32)." #endif - -#if defined(HAVE_QATOMIC_H) - -typedef QAtomicInt qtractorAtomic; - -#if QT_VERSION >= 0x050000 -#define ATOMIC_GET(a) ((a)->load()) -#define ATOMIC_SET(a,v) ((a)->store(v)) -#else -#define ATOMIC_GET(a) ((int) *(a)) -#define ATOMIC_SET(a,v) (*(a) = (v)) -#endif - -static inline int ATOMIC_CAS ( qtractorAtomic *pVal, - int iOldValue, int iNewValue ) -{ - return pVal->testAndSetOrdered(iOldValue, iNewValue); -} - -#else - typedef struct { volatile int value; } qtractorAtomic; #define ATOMIC_GET(a) ((a)->value)