* Merge in cygwin-64bit-branch.

This commit is contained in:
Corinna Vinschen
2013-04-23 09:44:36 +00:00
parent 1875ee55d3
commit 61522196c7
253 changed files with 10632 additions and 5055 deletions

View File

@@ -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*/