Don't use windows atomics unless compiler ones aren't available

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39932 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2016-06-27 19:05:40 +00:00
parent 055aa08a10
commit c0ad94e20b

View file

@ -187,26 +187,8 @@ static void GSLogZombie(id o, SEL sel)
#endif
#if defined(_WIN32)
#ifndef _WIN64
#undef InterlockedIncrement
#undef InterlockedDecrement
LONG WINAPI InterlockedIncrement(LONG volatile *);
LONG WINAPI InterlockedDecrement(LONG volatile *);
#endif
/* Set up atomic read, increment and decrement for mswindows
*/
typedef int32_t volatile *gsatomic_t;
#define GSATOMICREAD(X) (*(X))
#define GSAtomicIncrement(X) InterlockedIncrement(X)
#define GSAtomicDecrement(X) InterlockedDecrement(X)
#elif defined(__llvm__) || (defined(USE_ATOMIC_BUILTINS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)))
#if defined(__llvm__) || (defined(USE_ATOMIC_BUILTINS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)))
/* Use the GCC atomic operations with recent GCC versions */
typedef int32_t volatile *gsatomic_t;
@ -215,6 +197,25 @@ typedef int32_t volatile *gsatomic_t;
#define GSAtomicDecrement(X) __sync_sub_and_fetch(X, 1)
#elif defined(_WIN32)
/* Set up atomic read, increment and decrement for mswindows
*/
typedef int32_t volatile *gsatomic_t;
#ifndef _WIN64
#undef InterlockedIncrement
#undef InterlockedDecrement
LONG WINAPI InterlockedIncrement(LONG volatile *);
LONG WINAPI InterlockedDecrement(LONG volatile *);
#endif
#define GSATOMICREAD(X) (*(X))
#define GSAtomicIncrement(X) InterlockedIncrement(X)
#define GSAtomicDecrement(X) InterlockedDecrement(X)
#elif defined(__linux__) && (defined(__i386__) || defined(__x86_64__))
/* Set up atomic read, increment and decrement for intel style linux
*/