summaryrefslogtreecommitdiff
path: root/nonportable.c
diff options
context:
space:
mode:
Diffstat (limited to 'nonportable.c')
-rw-r--r--nonportable.c12
1 files changed, 10 insertions, 2 deletions
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;
}