Fixed declarations to match mingw includes
authorSam Lantinga <slouken@libsdl.org>
Mon, 06 Mar 2006 06:00:45 +0000
changeset 1470d47d96962fcc
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
     1.1 --- a/include/SDL_config_win32.h	Mon Mar 06 01:34:36 2006 +0000
     1.2 +++ b/include/SDL_config_win32.h	Mon Mar 06 06:00:45 2006 +0000
     1.3 @@ -52,7 +52,7 @@
     1.4  typedef signed long long int64_t;
     1.5  typedef unsigned long long uint64_t;
     1.6  typedef unsigned int size_t;
     1.7 -typedef unsigned long uintptr_t;
     1.8 +typedef unsigned int uintptr_t;
     1.9  #endif /* _MSC_VER */
    1.10  #define SDL_HAS_64BIT_TYPE	1
    1.11  
     2.1 --- a/include/SDL_thread.h	Mon Mar 06 01:34:36 2006 +0000
     2.2 +++ b/include/SDL_thread.h	Mon Mar 06 06:00:45 2006 +0000
     2.3 @@ -69,6 +69,11 @@
     2.4  #ifdef __OS2__
     2.5  typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
     2.6  typedef void (*pfnSDL_CurrentEndThread)(void);
     2.7 +#elif __GNUC__
     2.8 +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
     2.9 +        unsigned (__stdcall *func)(void *), void *arg, 
    2.10 +        unsigned, unsigned *threadID);
    2.11 +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
    2.12  #else
    2.13  typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
    2.14          unsigned (__stdcall *func)(void *), void *arg, 
     3.1 --- a/src/thread/win32/SDL_systhread.c	Mon Mar 06 01:34:36 2006 +0000
     3.2 +++ b/src/thread/win32/SDL_systhread.c	Mon Mar 06 06:00:45 2006 +0000
     3.3 @@ -59,16 +59,16 @@
     3.4  int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
     3.5  {
     3.6  	unsigned threadid;
     3.7 -    pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
     3.8 -    if (!pThreadParms) {
     3.9 +	pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
    3.10 +	if (!pThreadParms) {
    3.11  		SDL_OutOfMemory();
    3.12 -        return(-1);
    3.13 -    }
    3.14 +		return(-1);
    3.15 +	}
    3.16  
    3.17 -    // Save the function which we will have to call to clear the RTL of calling app!
    3.18 -    pThreadParms->pfnCurrentEndThread = pfnEndThread;
    3.19 -    // Also save the real parameters we have to pass to thread function
    3.20 -    pThreadParms->args = args;
    3.21 +	// Save the function which we will have to call to clear the RTL of calling app!
    3.22 +	pThreadParms->pfnCurrentEndThread = pfnEndThread;
    3.23 +	// Also save the real parameters we have to pass to thread function
    3.24 +	pThreadParms->args = args;
    3.25  
    3.26  	if (pfnBeginThread) {
    3.27  		thread->handle = (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread,