* Merge in cygwin-64bit-branch.
This commit is contained in:
@@ -11,7 +11,6 @@ details. */
|
||||
#ifndef _WINBASE2_H
|
||||
#define _WINBASE2_H
|
||||
|
||||
#ifndef __x86_64__
|
||||
extern __inline__ LONG
|
||||
ilockcmpexch (volatile LONG *t, LONG v, LONG c)
|
||||
{
|
||||
@@ -29,7 +28,30 @@ ilockcmpexch (volatile LONG *t, LONG v, LONG c)
|
||||
#undef InterlockedCompareExchange
|
||||
#define InterlockedCompareExchange ilockcmpexch
|
||||
#undef InterlockedCompareExchangePointer
|
||||
|
||||
#ifdef __x86_64__
|
||||
extern __inline__ LONGLONG
|
||||
ilockcmpexch64 (volatile LONGLONG *t, LONGLONG v, LONGLONG c)
|
||||
{
|
||||
return
|
||||
({
|
||||
register LONGLONG ret __asm ("%rax");
|
||||
__asm __volatile ("lock cmpxchgq %2, %1"
|
||||
: "=a" (ret), "=m" (*t)
|
||||
: "r" (v), "m" (*t), "0" (c)
|
||||
: "memory");
|
||||
ret;
|
||||
});
|
||||
}
|
||||
|
||||
#define InterlockedCompareExchange64 ilockcmpexch64
|
||||
#define InterlockedCompareExchangePointer(d,e,c) \
|
||||
(PVOID)InterlockedCompareExchange64((LONGLONG volatile *)(d),(LONGLONG)(e),(LONGLONG)(c))
|
||||
|
||||
#else
|
||||
|
||||
#define InterlockedCompareExchangePointer(d,e,c) \
|
||||
(PVOID)InterlockedCompareExchange((LONG volatile *)(d),(LONG)(e),(LONG)(c))
|
||||
|
||||
#endif /* !__x86_64 */
|
||||
#endif /*_WINBASE2_H*/
|
||||
|
Reference in New Issue
Block a user