mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Changed how synchronization functions are detected
This commit is contained in:
@@ -141,7 +141,7 @@ int AtomicCounter::operator -- (int) // postfix
|
||||
}
|
||||
|
||||
|
||||
#elif defined(CVF_HAVE_GCC_ATOMICS)
|
||||
#elif defined(CVF_GCC_DEFINED)
|
||||
|
||||
|
||||
AtomicCounter::AtomicCounter(int initialValue)
|
||||
|
||||
@@ -45,13 +45,8 @@
|
||||
#include <libkern/OSAtomic.h>
|
||||
#define CVF_ATOMIC_COUNTER_CLASS_EXISTS
|
||||
#elif defined __GNUC__
|
||||
#if (CVF_GCC_VER >= 40200) && (defined(__x86_64__) || defined(__i386__))
|
||||
#define CVF_HAVE_GCC_ATOMICS
|
||||
#define CVF_GCC_DEFINED
|
||||
#define CVF_ATOMIC_COUNTER_CLASS_EXISTS
|
||||
#elif (CVF_GCC_VER >= 40300)
|
||||
#define CVF_HAVE_GCC_ATOMICS
|
||||
#define CVF_ATOMIC_COUNTER_CLASS_EXISTS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS)
|
||||
|
||||
@@ -43,12 +43,8 @@
|
||||
|
||||
#include "cvfAtomicCounter.h"
|
||||
|
||||
#if defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS) && defined(CVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS)
|
||||
#error Two mutually exclusive defines detected : CVF_ATOMIC_COUNTER_CLASS_EXISTS && CVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS
|
||||
#endif
|
||||
|
||||
#if !defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS) && !defined(CVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS)
|
||||
#error No support for atomics. Define CVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS to be able to compile
|
||||
#if !defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS) && !defined(CVF_USE_NON_THREADSAFE_REFERENCE_COUNT)
|
||||
#error No support for atomics. Define CVF_USE_NON_THREADSAFE_REFERENCE_COUNT to be able to compile
|
||||
#endif
|
||||
|
||||
namespace cvf {
|
||||
@@ -75,10 +71,12 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
#if defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS)
|
||||
mutable AtomicCounter m_refCount;
|
||||
#elif defined(CVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS)
|
||||
#if defined(CVF_USE_NON_THREADSAFE_REFERENCE_COUNT)
|
||||
mutable int m_refCount;
|
||||
#elif defined(CVF_ATOMIC_COUNTER_CLASS_EXISTS)
|
||||
mutable AtomicCounter m_refCount;
|
||||
#else
|
||||
#error No support for atomics. Define CVF_USE_NON_THREADSAFE_REFERENCE_COUNT to be able to compile
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user