blob: f3754a59a19da3c5d28d45b4fd016a9e2abab194 [file] [log] [blame]
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#define __CRT__NO_INLINE
#include <windows.h>
#undef InterlockedCompareExchange
LONG _InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand)
{
LONG prev;
__asm__ __volatile__("lock ; cmpxchgl %1,%2" : "=a" (prev) : "q" (ExChange),"m" (*Destination), "0" (Comperand) : "memory");
return prev;
}
LONG InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand)
__attribute__((alias("_InterlockedCompareExchange")));