Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library.

This commit is contained in:
Sam Lantinga 2013-03-07 20:42:55 -08:00
parent c6388c87c1
commit 1494812f7c
2 changed files with 8 additions and 8 deletions

View file

@ -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! * \note If you don't know what this function is for, you shouldn't use it!
*/ */
#ifndef SDL_AtomicCAS #ifndef SDL_AtomicCAS
#define SDL_AtomicCAS SDL_AtomicCAS_ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
#endif #endif
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval);
/** /**
* \brief Set an atomic variable to a value. * \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! * \note If you don't know what this function is for, you shouldn't use it!
*/ */
#ifndef SDL_AtomicCASPtr #ifndef SDL_AtomicCASPtr
#define SDL_AtomicCASPtr SDL_AtomicCASPtr_ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval);
#endif #endif
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr_(void* *a, void *oldval, void *newval);
/** /**
* \brief Set a pointer to a value atomically. * \brief Set a pointer to a value atomically.

View file

@ -27,6 +27,8 @@
doesn't have that compiler. That way we always have a working set of doesn't have that compiler. That way we always have a working set of
atomic operations built into the library. 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 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_AtomicUnlock(&locks[index]);
} }
SDL_bool DECLSPEC SDL_bool SDLCALL
SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval) SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
{ {
SDL_bool retval = SDL_FALSE; SDL_bool retval = SDL_FALSE;
@ -84,8 +86,8 @@ SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval)
return retval; return retval;
} }
SDL_bool DECLSPEC SDL_bool SDLCALL
SDL_AtomicCASPtr_(void **a, void *oldval, void *newval) SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
{ {
SDL_bool retval = SDL_FALSE; SDL_bool retval = SDL_FALSE;