Use #ifdef/#ifndef instead of #if defined/#if \!defined

This commit is contained in:
Anonymous Maarten
2023-03-30 20:26:31 +02:00
committed by Anonymous Maarten
parent 308bcbbe76
commit b6ae281e97
129 changed files with 450 additions and 450 deletions

View File

@@ -25,7 +25,7 @@
#define HAVE_MSC_ATOMICS 1
#endif
#if defined(__MACOS__) /* !!! FIXME: should we favor gcc atomics? */
#ifdef __MACOS__ /* !!! FIXME: should we favor gcc atomics? */
#include <libkern/OSAtomic.h>
#endif
@@ -34,11 +34,11 @@
#endif
/* The __atomic_load_n() intrinsic showed up in different times for different compilers. */
#if defined(__clang__)
#ifdef __clang__
#if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS)
/* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
It might be in a later NDK or we might need an extra library? --ryan. */
#if !defined(__ANDROID__)
#ifndef __ANDROID__
#define HAVE_ATOMIC_LOAD_N 1
#endif
#endif
@@ -155,7 +155,7 @@ SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval)
SDL_bool
SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
{
#if defined(HAVE_MSC_ATOMICS)
#ifdef HAVE_MSC_ATOMICS
return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval;
#elif defined(HAVE_WATCOM_ATOMICS)
return (SDL_bool)_SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval);
@@ -206,7 +206,7 @@ int SDL_AtomicSet(SDL_AtomicInt *a, int v)
void *
SDL_AtomicSetPtr(void **a, void *v)
{
#if defined(HAVE_MSC_ATOMICS)
#ifdef HAVE_MSC_ATOMICS
return _InterlockedExchangePointer(a, v);
#elif defined(HAVE_WATCOM_ATOMICS)
return (void *)_SDL_xchg_watcom((int *)a, (long)v);

View File

@@ -36,7 +36,7 @@
#include <xmmintrin.h>
#endif
#if defined(PS2)
#ifdef PS2
#include <kernel.h>
#endif
@@ -60,7 +60,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
SDL_bool
SDL_AtomicTryLock(SDL_SpinLock *lock)
{
#if defined(SDL_ATOMIC_DISABLED)
#ifdef SDL_ATOMIC_DISABLED
/* Terrible terrible damage */
static SDL_mutex *_spinlock_mutex;
@@ -98,7 +98,7 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
defined(__ARM_ARCH_5TEJ__))
int result;
#if defined(__RISCOS__)
#ifdef __RISCOS__
if (__cpucap_have_rex()) {
__asm__ __volatile__(
"ldrex %0, [%2]\nteq %0, #0\nstrexeq %0, %1, [%2]"