Made the Interlocked*Pointer functions static inline since they aren't

exported by the Windows API.
oldstable
Alexandre Julliard 2001-08-17 00:08:20 +00:00
parent e22a1e68cf
commit e08a1b5396
2 changed files with 12 additions and 24 deletions

View File

@ -1952,24 +1952,6 @@ extern inline LONG WINAPI InterlockedExchange( PLONG dest, LONG val )
return ret;
}
extern inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID *dest, PVOID xchg, PVOID compare );
extern inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID *dest, PVOID xchg, PVOID compare )
{
PVOID ret;
__asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
return ret;
}
extern inline PVOID WINAPI InterlockedExchangePointer( PVOID *dest, PVOID val );
extern inline PVOID WINAPI InterlockedExchangePointer( PVOID *dest, PVOID val )
{
PVOID ret;
__asm__ __volatile__( "lock; xchgl %0,(%1)"
: "=r" (ret) :"r" (dest), "0" (val) : "memory" );
return ret;
}
extern inline LONG WINAPI InterlockedExchangeAdd( PLONG dest, LONG incr );
extern inline LONG WINAPI InterlockedExchangeAdd( PLONG dest, LONG incr )
{
@ -2040,13 +2022,19 @@ LONG WINAPI InterlockedExchange(PLONG,LONG);
LONG WINAPI InterlockedExchangeAdd(PLONG,LONG);
LONG WINAPI InterlockedIncrement(PLONG);
VOID WINAPI SetLastError(DWORD);
/* FIXME: should handle platforms where sizeof(void*) != sizeof(long) */
#define InterlockedCompareExchangePointer(a,b,c) \
((PVOID)InterlockedCompareExchange((PLONG)(a),(LONG)(b),(LONG)(c)))
#define InterlockedExchangePointer(a,b) \
((PVOID)InterlockedExchange((PLONG)(a),(LONG)(b)))
#endif /* __i386__ && __GNUC__ */
/* FIXME: should handle platforms where sizeof(void*) != sizeof(long) */
static inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID *dest, PVOID xchg, PVOID compare )
{
return (PVOID)InterlockedCompareExchange( (PLONG)dest, (LONG)xchg, (LONG)compare );
}
static inline PVOID WINAPI InterlockedExchangePointer( PVOID *dest, PVOID val )
{
return (PVOID)InterlockedExchange( (PLONG)dest, (LONG)val );
}
#ifdef __WINE__
#define GetCurrentProcess() ((HANDLE)0xffffffff)
#define GetCurrentThread() ((HANDLE)0xfffffffe)

View File

@ -86,7 +86,7 @@ void WINAPI UninitializeCriticalSection( CRITICAL_SECTION *crit )
/***********************************************************************
* InterlockedCompareExchange (KERNEL32.@)
*/
/* PVOID WINAPI InterlockedCompareExchange( PVOID *dest, PVOID xchg, PVOID compare ); */
/* LONG WINAPI InterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare ); */
__ASM_GLOBAL_FUNC(InterlockedCompareExchange,
"movl 12(%esp),%eax\n\t"
"movl 8(%esp),%ecx\n\t"