From 62ca1a42e77f08a0ece4b66ef05e76f5199f6eb7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 7 Mar 2013 20:42:55 -0800 Subject: [PATCH] Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library. --- include/SDL_atomic.h | 6 ++---- src/atomic/SDL_atomic.c | 10 ++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h index bba530102..c89d0b71d 100644 --- a/include/SDL_atomic.h +++ b/include/SDL_atomic.h @@ -196,9 +196,8 @@ typedef struct { int value; } SDL_atomic_t; * \note If you don't know what this function is for, you shouldn't use it! */ #ifndef SDL_AtomicCAS -#define SDL_AtomicCAS SDL_AtomicCAS_ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); #endif -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval); /** * \brief Set an atomic variable to a value. @@ -271,9 +270,8 @@ static __inline__ int SDL_AtomicAdd(SDL_atomic_t *a, int v) * \note If you don't know what this function is for, you shouldn't use it! */ #ifndef SDL_AtomicCASPtr -#define SDL_AtomicCASPtr SDL_AtomicCASPtr_ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval); #endif -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr_(void* *a, void *oldval, void *newval); /** * \brief Set a pointer to a value atomically. diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index 34a298edc..6cf2384a5 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -27,6 +27,8 @@ doesn't have that compiler. That way we always have a working set of atomic operations built into the library. */ +#undef SDL_AtomicCAS +#undef SDL_AtomicCASPtr /* If any of the operations are not provided then we must emulate some @@ -69,8 +71,8 @@ leaveLock(void *a) SDL_AtomicUnlock(&locks[index]); } -SDL_bool -SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval) +DECLSPEC SDL_bool SDLCALL +SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) { SDL_bool retval = SDL_FALSE; @@ -84,8 +86,8 @@ SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval) return retval; } -SDL_bool -SDL_AtomicCASPtr_(void **a, void *oldval, void *newval) +DECLSPEC SDL_bool SDLCALL +SDL_AtomicCASPtr(void **a, void *oldval, void *newval) { SDL_bool retval = SDL_FALSE;