update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -103,10 +103,10 @@ extern __inline int _SDL_xadd_watcom(volatile int *a, int v);
*/
#if !defined(HAVE_MSC_ATOMICS) && !defined(HAVE_GCC_ATOMICS) && !defined(__MACOSX__) && !defined(__SOLARIS__) && !defined(HAVE_WATCOM_ATOMICS)
#define EMULATE_CAS 1
#define EMULATE_CAS
#endif
#if EMULATE_CAS
#ifdef EMULATE_CAS
static SDL_SpinLock locks[32];
static SDL_INLINE void enterLock(void *a)
@ -137,7 +137,7 @@ SDL_bool SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
return (SDL_bool) OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value);
#elif defined(__SOLARIS__)
return (SDL_bool)((int)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval);
#elif EMULATE_CAS
#elif defined(EMULATE_CAS)
SDL_bool retval = SDL_FALSE;
enterLock(a);
@ -167,7 +167,7 @@ SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
return (SDL_bool) OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t*) a);
#elif defined(__SOLARIS__)
return (SDL_bool)(atomic_cas_ptr(a, oldval, newval) == oldval);
#elif EMULATE_CAS
#elif defined(EMULATE_CAS)
SDL_bool retval = SDL_FALSE;
enterLock(a);
@ -259,7 +259,7 @@ int SDL_AtomicGet(SDL_atomic_t *a)
#elif defined(__MACOSX__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
return sizeof(a->value) == sizeof(uint32_t) ? OSAtomicOr32Barrier(0, (volatile uint32_t *)&a->value) : OSAtomicAdd64Barrier(0, (volatile int64_t *)&a->value);
#elif defined(__SOLARIS__)
return atomic_or_uint((volatile uint_t *)&a->value, 0);
return atomic_or_uint_nv((volatile uint_t *)&a->value, 0);
#else
int value;
do {

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -63,11 +63,11 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
/* This function is where all the magic happens... */
SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock)
{
#if SDL_ATOMIC_DISABLED
#ifdef SDL_ATOMIC_DISABLED
/* Terrible terrible damage */
static SDL_mutex *_spinlock_mutex;
if (_spinlock_mutex == NULL) {
if (!_spinlock_mutex) {
/* Race condition on first lock... */
_spinlock_mutex = SDL_CreateMutex();
}
@ -81,7 +81,7 @@ SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock)
return SDL_FALSE;
}
#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
#elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
return __sync_lock_test_and_set(lock, 1) == 0;
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
@ -186,7 +186,7 @@ void SDL_AtomicLock(SDL_SpinLock *lock)
void SDL_AtomicUnlock(SDL_SpinLock *lock)
{
#if HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
__sync_lock_release(lock);
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))