Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the …

…library.
  • Loading branch information
slouken committed Mar 8, 2013
1 parent 9a1385b commit 62ca1a42e77f08a0ece4b66ef05e76f5199f6eb7
Showing with 8 additions and 8 deletions.
  1. +2 −4 include/SDL_atomic.h
  2. +6 −4 src/atomic/SDL_atomic.c
@@ -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.
@@ -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;

0 comments on commit 62ca1a4

Please sign in to comment.