From 820ca4b34c23ef8d91edade437f0f9fd781f8b89 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 25 Oct 2001 23:51:53 +0000 Subject: * 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. --- nonportable.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nonportable.c') diff --git a/nonportable.c b/nonportable.c index de9dc07..27363c1 100644 --- a/nonportable.c +++ b/nonportable.c @@ -194,13 +194,15 @@ pthread_win32_process_attach_np () pthread_count++; #endif +#ifndef TEST_ICE + /* * Load KERNEL32 and try to get address of InterlockedCompareExchange */ ptw32_h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); ptw32_interlocked_compare_exchange = - (PTW32_INTERLOCKED_LONG (PT_STDCALL *)(PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG)) + (PTW32_INTERLOCKED_LONG (WINAPI *)(PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, PTW32_INTERLOCKED_LONG)) #if defined(NEED_UNICODE_CONSTS) GetProcAddress(ptw32_h_kernel32, (const TCHAR *)TEXT("InterlockedCompareExchange")); @@ -211,7 +213,7 @@ pthread_win32_process_attach_np () if (ptw32_interlocked_compare_exchange == NULL) { - ptw32_interlocked_compare_exchange = &ptw32_InterlockedCompareExchange; + ptw32_interlocked_compare_exchange = ptw32_InterlockedCompareExchange; /* * If InterlockedCompareExchange is not being used, then free @@ -231,6 +233,12 @@ pthread_win32_process_attach_np () ptw32_h_kernel32 = 0; } +#else /* TEST_ICE */ + + ptw32_interlocked_compare_exchange = ptw32_InterlockedCompareExchange; + +#endif /* TEST_ICE */ + return result; } -- cgit v1.2.3