Fixed declarations to match mingw includes
authorSam Lantinga <slouken@libsdl.org>
Mon, 06 Mar 2006 06:00:45 +0000
changeset 1470 d47d96962fcc
parent 1469 bf867c1e57e3
child 1471 9fb0eee04dd9
Fixed declarations to match mingw includes
include/SDL_config_win32.h
include/SDL_thread.h
src/thread/win32/SDL_systhread.c
--- a/include/SDL_config_win32.h	Mon Mar 06 01:34:36 2006 +0000
+++ b/include/SDL_config_win32.h	Mon Mar 06 06:00:45 2006 +0000
@@ -52,7 +52,7 @@
 typedef signed long long int64_t;
 typedef unsigned long long uint64_t;
 typedef unsigned int size_t;
-typedef unsigned long uintptr_t;
+typedef unsigned int uintptr_t;
 #endif /* _MSC_VER */
 #define SDL_HAS_64BIT_TYPE	1
 
--- a/include/SDL_thread.h	Mon Mar 06 01:34:36 2006 +0000
+++ b/include/SDL_thread.h	Mon Mar 06 06:00:45 2006 +0000
@@ -69,6 +69,11 @@
 #ifdef __OS2__
 typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
 typedef void (*pfnSDL_CurrentEndThread)(void);
+#elif __GNUC__
+typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+        unsigned (__stdcall *func)(void *), void *arg, 
+        unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
 #else
 typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
         unsigned (__stdcall *func)(void *), void *arg, 
--- a/src/thread/win32/SDL_systhread.c	Mon Mar 06 01:34:36 2006 +0000
+++ b/src/thread/win32/SDL_systhread.c	Mon Mar 06 06:00:45 2006 +0000
@@ -59,16 +59,16 @@
 int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
 {
 	unsigned threadid;
-    pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
-    if (!pThreadParms) {
+	pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
+	if (!pThreadParms) {
 		SDL_OutOfMemory();
-        return(-1);
-    }
+		return(-1);
+	}
 
-    // Save the function which we will have to call to clear the RTL of calling app!
-    pThreadParms->pfnCurrentEndThread = pfnEndThread;
-    // Also save the real parameters we have to pass to thread function
-    pThreadParms->args = args;
+	// Save the function which we will have to call to clear the RTL of calling app!
+	pThreadParms->pfnCurrentEndThread = pfnEndThread;
+	// Also save the real parameters we have to pass to thread function
+	pThreadParms->args = args;
 
 	if (pfnBeginThread) {
 		thread->handle = (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread,