/* Note: for Cygwin and win32-pthread, this is skipped */
/* unless windows.h is included before gc.h. */
-# ifndef GC_NO_THREAD_DECLS
+# if !defined(GC_NO_THREAD_DECLS) || defined(GC_BUILD)
# ifdef __cplusplus
} /* Including windows.h in an extern "C" context no longer works. */
LPVOID /* reserved */);
# endif /* GC_INSIDE_DLL */
+# if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) \
+ && !defined(UINTPTR_MAX)
+ typedef GC_word GC_uintptr_t;
+# else
+ typedef uintptr_t GC_uintptr_t;
+# endif
+# define GC_WIN32_SIZE_T GC_uintptr_t
+
/* All threads must be created using GC_CreateThread or */
/* GC_beginthreadex, or must explicitly call GC_register_my_thread */
/* (and call GC_unregister_my_thread before thread termination), so */
/* so that the thread is properly unregistered. */
GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES /* lpThreadAttributes */,
- DWORD /* dwStackSize */,
+ GC_WIN32_SIZE_T /* dwStackSize */,
LPTHREAD_START_ROUTINE /* lpStartAddress */,
LPVOID /* lpParameter */, DWORD /* dwCreationFlags */,
LPDWORD /* lpThreadId */);
DWORD /* dwExitCode */);
# if !defined(_WIN32_WCE) && !defined(__CEGCC__)
-# if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) \
- && !defined(UINTPTR_MAX)
- typedef GC_word GC_uintptr_t;
-# else
- typedef uintptr_t GC_uintptr_t;
-# endif
-
GC_API GC_uintptr_t GC_CALL GC_beginthreadex(
void * /* security */, unsigned /* stack_size */,
unsigned (__stdcall *)(void *),
{
DWORD thread_id;
HANDLE h;
- h = GC_CreateThread(NULL, 0, tiny_reverse_test, 0, 0, &thread_id);
+ h = GC_CreateThread((SECURITY_ATTRIBUTES *)NULL, (word)0,
+ tiny_reverse_test, NULL, (DWORD)0, &thread_id);
+ /* Explicitly specify types of the */
+ /* arguments to test the prototype. */
if (h == (HANDLE)NULL) {
GC_printf("Small thread creation failed %d\n",
(int)GetLastError());
GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
- DWORD dwStackSize,
+ GC_WIN32_SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags,
LPDWORD lpThreadId)