Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library.
authorSam Lantinga <slouken@libsdl.org>
Thu, 07 Mar 2013 20:42:55 -0800
changeset 6978 e851407e9294
parent 6977 b73d51026c68
child 6979 8d6ab3bdc08b
Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library.
include/SDL_atomic.h
src/atomic/SDL_atomic.c
--- a/include/SDL_atomic.h	Thu Mar 07 20:12:40 2013 -0800
+++ b/include/SDL_atomic.h	Thu Mar 07 20:42:55 2013 -0800
@@ -196,9 +196,8 @@
  * \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 @@
  * \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.
--- a/src/atomic/SDL_atomic.c	Thu Mar 07 20:12:40 2013 -0800
+++ b/src/atomic/SDL_atomic.c	Thu Mar 07 20:42:55 2013 -0800
@@ -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 @@
     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 @@
     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;