X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=tools%2Fquake3%2Fcommon%2Fthreads.c;h=054dc746625ef214d0b73ecc65793160db865cc6;hp=04946dd2f72edfc87566a954fee655d57becd854;hb=0a8e8e98c332c54c5a1cbc0a22b1e0483075a6b5;hpb=f806ac65b11eb35a8ffd5df61ac1aed06763d49e diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 04946dd2..054dc746 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. + Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -19,7 +19,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef WIN32 +#include "globaldefs.h" +#if !GDEF_OS_WINDOWS // The below define is necessary to use // pthreads extensions like pthread_mutexattr_settype #define _GNU_SOURCE @@ -116,7 +117,7 @@ void RunThreadsOnIndividual( int workcnt, qboolean showpacifier, void ( *func )( =================================================================== */ -#ifdef WIN32 +#if GDEF_OS_WINDOWS #define USED @@ -424,7 +425,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ ======================================================================= */ -#if defined( __linux__ ) || ( defined( __APPLE__ ) && !MAC_STATIC_HACK ) +#if GDEF_OS_LINUX || ( GDEF_OS_MACOS && !MAC_STATIC_HACK ) #define USED #include @@ -576,7 +577,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ for ( i = 0 ; i < numthreads ; i++ ) { /* Default pthread attributes: joinable & non-realtime scheduling */ - if ( pthread_create( &work_threads[i], &attr, (void*)func, (void*)(size_t)i ) != 0 ) { + if ( pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(uintptr_t)i ) != 0 ) { Error( "pthread_create failed" ); } } @@ -626,7 +627,6 @@ void ThreadUnlock( void ){ ============= */ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ - int i; int start, end; dispatch = 0;