Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed compiler warnings using Windows intrinsics
  • Loading branch information
slouken committed Jan 17, 2011
1 parent cd5c25d commit 05f0bae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/SDL_atomic.h
Expand Up @@ -115,12 +115,12 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
#if defined(__WIN32__)
#include <intrin.h>

#define SDL_AtomicSet(a, v) _InterlockedExchange(&(a)->value, (v))
#define SDL_AtomicSet(a, v) _InterlockedExchange((long*)&(a)->value, (v))
#define SDL_AtomicGet(a) ((a)->value)
#define SDL_AtomicAdd(a, v) _InterlockedExchangeAdd(&(a)->value, (v))
#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange(&(a)->value, (newval), (oldval)) == (oldval))
#define SDL_AtomicAdd(a, v) _InterlockedExchangeAdd((long*)&(a)->value, (v))
#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
#define SDL_AtomicSetPtr(a, v) (void)_InterlockedExchangePointer((a), (v))
#define SDL_AtomicGetPtr(a) (*(a))
#define SDL_AtomicGetPtr(a) (*(a))
#if _M_IX86
#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
#else
Expand Down

0 comments on commit 05f0bae

Please sign in to comment.