]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/winbase.h
Throughout, update copyrights to reflect dates which correspond to main-branch
[newlib-cygwin.git] / winsup / cygwin / winbase.h
CommitLineData
0d963613
CV
1/* winbase.h
2
bc837d22 3 Copyright 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2012 Red Hat, Inc.
0d963613
CV
4
5This software is a copyrighted work licensed under the terms of the
6Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7details. */
8
9#include_next "winbase.h"
10
11#ifndef _WINBASE2_H
12#define _WINBASE2_H
13
14#ifndef __x86_64__
15extern __inline__ LONG
16ilockcmpexch (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*/
This page took 0.032851 seconds and 5 git commands to generate.