Bug 415563: Add type casts to the arguments in the atomic macro definitions

for Windows.  The patch is contributed by Steve Snyder
<swsnyder@snydernet.net>.  r=wtc.


git-svn-id: svn://10.0.0.236/trunk@260659 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com 2010-07-07 22:00:19 +00:00
parent c35963979d
commit 1ebc8dd2b6

View File

@ -125,10 +125,12 @@ long __cdecl _InterlockedExchange(long volatile *Target, long Value);
long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value);
#pragma intrinsic(_InterlockedExchangeAdd)
#define PR_ATOMIC_INCREMENT(val) _InterlockedIncrement(val)
#define PR_ATOMIC_DECREMENT(val) _InterlockedDecrement(val)
#define PR_ATOMIC_SET(val, newval) _InterlockedExchange(val, newval)
#define PR_ATOMIC_ADD(ptr, val) (_InterlockedExchangeAdd(ptr, val) + (val))
#define PR_ATOMIC_INCREMENT(val) _InterlockedIncrement((long volatile *)(val))
#define PR_ATOMIC_DECREMENT(val) _InterlockedDecrement((long volatile *)(val))
#define PR_ATOMIC_SET(val, newval) \
_InterlockedExchange((long volatile *)(val), (long)(newval))
#define PR_ATOMIC_ADD(ptr, val) \
(_InterlockedExchangeAdd((long volatile *)(ptr), (long)(val)) + (val))
#elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \
((defined(DARWIN) && \