mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2025-01-31 21:10:47 +00:00
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:
parent
f8efcf5e90
commit
670f2f2be8
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue