Commit e08a1b53 authored by Alexandre Julliard's avatar Alexandre Julliard

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

exported by the Windows API.
parent e22a1e68
......@@ -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)
......
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment