summaryrefslogtreecommitdiff
path: root/private.c
diff options
context:
space:
mode:
authorrpj <rpj>2001-10-25 23:51:53 +0000
committerrpj <rpj>2001-10-25 23:51:53 +0000
commit820ca4b34c23ef8d91edade437f0f9fd781f8b89 (patch)
tree0cf9a2f78eea742c19761b071479d94644278195 /private.c
parent222a76c37c89ee37eebecd53dd32fd481245e6fa (diff)
* GNUmakefile (libwsock32): Add to linker flags for
WSAGetLastError() and WSASetLastError(). * Makefile (wsock32.lib): Likewise. * create.c: Minor mostly inert changes. * implement.h (PTW32_MAX): Move into here and renamed from sched.h. (PTW32_MIN): Likewise. * GNUmakefile (TEST_ICE): Define if testing internal implementation of InterlockedCompareExchange. * Makefile (TEST_ICE): Likewise. * private.c (TEST_ICE): Likewise.
Diffstat (limited to 'private.c')
-rw-r--r--private.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/private.c b/private.c
index f97d9f4..ffe44e1 100644
--- a/private.c
+++ b/private.c
@@ -1033,8 +1033,8 @@ ptw32_pop_cleanup_all(int execute)
* This can't be inlined because we need to know it's address so that
* we can call it through a pointer.
*/
-PTW32_INTERLOCKED_LONG
-ptw32_InterlockedCompareExchange(PTW32_INTERLOCKED_LPLONG ptr,
+PTW32_INTERLOCKED_LONG WINAPI
+ptw32_InterlockedCompareExchange(PTW32_INTERLOCKED_LPLONG location,
PTW32_INTERLOCKED_LONG value,
PTW32_INTERLOCKED_LONG comparand)
{
@@ -1042,13 +1042,13 @@ ptw32_InterlockedCompareExchange(PTW32_INTERLOCKED_LPLONG ptr,
#if defined(_M_IX86) || defined(_X86_)
-#if defined(__MSVCRT__)
+#if defined(_MSC_VER)
_asm {
PUSH ecx
PUSH edx
- MOV ecx,dword ptr [ptr] ; Load ECX with plTarget
- MOV edx,dword ptr [value] ; Load EDX with lValue
+ MOV ecx,dword ptr [location]
+ MOV edx,dword ptr [value]
MOV eax,dword ptr [comparand]
LOCK CMPXCHG dword ptr [ecx],edx ; if (EAX == [ECX]),
; [ECX] = EDX
@@ -1064,12 +1064,12 @@ ptw32_InterlockedCompareExchange(PTW32_INTERLOCKED_LPLONG ptr,
__asm__
(
"lock\n\t"
- "cmpxchgl %3,(%0)" /* if (EAX == [ptr]), */
- /* [ptr] = value */
- /* else */
- /* EAX = [ptr] */
- :"=r" (ptr), "=a" (result)
- :"0" (ptr), "q" (value), "a" (comparand)
+ "cmpxchgl %3,(%0)" /* if (EAX == [location]), */
+ /* [location] = value */
+ /* else */
+ /* EAX = [location] */
+ :"=r" (location), "=a" (result)
+ :"0" (location), "q" (value), "a" (comparand)
: "memory" );
#endif