]>
Commit | Line | Data |
---|---|---|
0d963613 CV |
1 | /* winbase.h |
2 | ||
bc837d22 | 3 | Copyright 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2012 Red Hat, Inc. |
0d963613 CV |
4 | |
5 | This software is a copyrighted work licensed under the terms of the | |
6 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
7 | details. */ | |
8 | ||
9 | #include_next "winbase.h" | |
10 | ||
11 | #ifndef _WINBASE2_H | |
12 | #define _WINBASE2_H | |
13 | ||
14 | #ifndef __x86_64__ | |
15 | extern __inline__ LONG | |
16 | ilockcmpexch (volatile LONG *t, LONG v, LONG c) | |
17 | { | |
18 | return | |
19 | ({ | |
20 | register LONG ret __asm ("%eax"); | |
21 | __asm __volatile ("lock cmpxchgl %2, %1" | |
22 | : "=a" (ret), "=m" (*t) | |
23 | : "r" (v), "m" (*t), "0" (c) | |
24 | : "memory"); | |
25 | ret; | |
26 | }); | |
27 | } | |
28 | ||
29 | #undef InterlockedCompareExchange | |
30 | #define InterlockedCompareExchange ilockcmpexch | |
31 | #undef InterlockedCompareExchangePointer | |
32 | #define InterlockedCompareExchangePointer(d,e,c) \ | |
33 | (PVOID)InterlockedCompareExchange((LONG volatile *)(d),(LONG)(e),(LONG)(c)) | |
34 | #endif /* !__x86_64 */ | |
35 | #endif /*_WINBASE2_H*/ |