// The below define is necessary to use
// pthreads extensions like pthread_mutexattr_settype
#define _GNU_SOURCE
-#include <pthread.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#include "cmdlib.h"
#include "mathlib.h"
}
+#if GDEF_OS_WINDOWS
+
/*
===================================================================
===================================================================
*/
-#if GDEF_OS_WINDOWS
-
-#define USED
#include <windows.h>
}
-#endif
+#elif GDEF_OS_OSF1
/*
===================================================================
===================================================================
*/
-#ifdef __osf__
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
}
}
-
#include <pthread.h>
pthread_mutex_t *my_mutex;
}
-#endif
+#elif GDEF_OS_IRIX
/*
===================================================================
===================================================================
*/
-#ifdef _MIPS_ISA
-#define USED
-
#include <task.h>
#include <abi_mutex.h>
#include <sys/types.h>
#include <sys/prctl.h>
-
int numthreads = -1;
abilock_t lck;
}
-#endif
-
+#elif GDEF_OS_LINUX || GDEF_OS_BSD || GDEF_OS_MACOS
/*
=======================================================================
=======================================================================
*/
-#if GDEF_OS_LINUX
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
Sys_Printf( " (%i)\n", end - start );
}
}
-#endif // ifdef __linux__
+#else // UNKNOWN OS
+
/*
=======================================================================
=======================================================================
*/
-#ifndef USED
-
int numthreads = 1;
void ThreadSetDefault( void ){
}
}
-#endif
+#endif // UNKNOWN OS