Fix platform dependent thread function definitions

Thread return types are different between platforms, and its
probably not a good idea to return something of a different size,
cast the callback and expect it to not crash.
This commit is contained in:
dhewg 2011-12-01 18:01:13 +01:00 committed by Daniel Gibson
parent f8efcf5e90
commit 670f2f2be8

View file

@ -59,6 +59,8 @@ If you have questions concerning this license or the applicable additional terms
#define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) )
#define THREAD_RETURN_TYPE dword
#endif
// Mac OSX
@ -97,6 +99,8 @@ If you have questions concerning this license or the applicable additional terms
#define assertmem( x, y )
#define THREAD_RETURN_TYPE void *
#endif
@ -136,6 +140,8 @@ If you have questions concerning this license or the applicable additional terms
#define assertmem( x, y )
#define THREAD_RETURN_TYPE void *
#endif
#ifdef __GNUC__
@ -482,7 +488,7 @@ void Sys_ShutdownNetworking( void );
==============================================================
*/
typedef unsigned int (*xthread_t)( void * );
typedef THREAD_RETURN_TYPE (*xthread_t)( void * );
typedef enum {
THREAD_NORMAL,
@ -492,8 +498,8 @@ typedef enum {
typedef struct {
const char * name;
int threadHandle;
unsigned long threadId;
intptr_t threadHandle;
size_t threadId;
} xthreadInfo;
const int MAX_THREADS = 10;