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 6978e851407e9294
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
     1.1 --- a/include/SDL_atomic.h	Thu Mar 07 20:12:40 2013 -0800
     1.2 +++ b/include/SDL_atomic.h	Thu Mar 07 20:42:55 2013 -0800
     1.3 @@ -196,9 +196,8 @@
     1.4   * \note If you don't know what this function is for, you shouldn't use it!
     1.5  */
     1.6  #ifndef SDL_AtomicCAS
     1.7 -#define SDL_AtomicCAS SDL_AtomicCAS_
     1.8 +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
     1.9  #endif
    1.10 -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval);
    1.11  
    1.12  /**
    1.13   * \brief Set an atomic variable to a value.
    1.14 @@ -271,9 +270,8 @@
    1.15   * \note If you don't know what this function is for, you shouldn't use it!
    1.16  */
    1.17  #ifndef SDL_AtomicCASPtr
    1.18 -#define SDL_AtomicCASPtr SDL_AtomicCASPtr_
    1.19 +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval);
    1.20  #endif
    1.21 -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr_(void* *a, void *oldval, void *newval);
    1.22  
    1.23  /**
    1.24   * \brief Set a pointer to a value atomically.
     2.1 --- a/src/atomic/SDL_atomic.c	Thu Mar 07 20:12:40 2013 -0800
     2.2 +++ b/src/atomic/SDL_atomic.c	Thu Mar 07 20:42:55 2013 -0800
     2.3 @@ -27,6 +27,8 @@
     2.4     doesn't have that compiler.  That way we always have a working set of
     2.5     atomic operations built into the library.
     2.6  */
     2.7 +#undef SDL_AtomicCAS
     2.8 +#undef SDL_AtomicCASPtr
     2.9   
    2.10  /* 
    2.11    If any of the operations are not provided then we must emulate some
    2.12 @@ -69,8 +71,8 @@
    2.13      SDL_AtomicUnlock(&locks[index]);
    2.14  }
    2.15  
    2.16 -SDL_bool
    2.17 -SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval)
    2.18 +DECLSPEC SDL_bool SDLCALL
    2.19 +SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
    2.20  {
    2.21      SDL_bool retval = SDL_FALSE;
    2.22  
    2.23 @@ -84,8 +86,8 @@
    2.24      return retval;
    2.25  }
    2.26  
    2.27 -SDL_bool
    2.28 -SDL_AtomicCASPtr_(void **a, void *oldval, void *newval)
    2.29 +DECLSPEC SDL_bool SDLCALL
    2.30 +SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
    2.31  {
    2.32      SDL_bool retval = SDL_FALSE;
    2.33