summaryrefslogtreecommitdiff
path: root/src/threading.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/threading.h')
-rw-r--r--src/threading.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/threading.h b/src/threading.h
index 1d304fa..1b218b9 100644
--- a/src/threading.h
+++ b/src/threading.h
@@ -11,6 +11,8 @@
11 */ 11 */
12#ifdef _WIN32_WCE 12#ifdef _WIN32_WCE
13 #define PLATFORM_POCKETPC 13 #define PLATFORM_POCKETPC
14#elif defined(_XBOX)
15 #define PLATFORM_XBOX
14#elif (defined _WIN32) 16#elif (defined _WIN32)
15 #define PLATFORM_WIN32 17 #define PLATFORM_WIN32
16#elif (defined __linux__) 18#elif (defined __linux__)
@@ -47,7 +49,7 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED };
47#define THREADAPI_WINDOWS 1 49#define THREADAPI_WINDOWS 1
48#define THREADAPI_PTHREAD 2 50#define THREADAPI_PTHREAD 2
49 51
50#if( defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC)) && !defined( HAVE_WIN32_PTHREAD) 52#if( defined( PLATFORM_XBOX) || defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC)) && !defined( HAVE_WIN32_PTHREAD)
51#define THREADAPI THREADAPI_WINDOWS 53#define THREADAPI THREADAPI_WINDOWS
52#else // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) 54#else // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC)
53#define THREADAPI THREADAPI_PTHREAD 55#define THREADAPI THREADAPI_PTHREAD
@@ -57,10 +59,14 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED };
57*/ 59*/
58 60
59#if THREADAPI == THREADAPI_WINDOWS 61#if THREADAPI == THREADAPI_WINDOWS
60 #define WIN32_LEAN_AND_MEAN 62 #if defined ( PLATFORM_XBOX)
61 // 'SignalObjectAndWait' needs this (targets Windows 2000 and above) 63 #include <xtl.h>
62 #define _WIN32_WINNT 0x0400 64 #else // !PLATFORM_XBOX
63 #include <windows.h> 65 #define WIN32_LEAN_AND_MEAN
66 // 'SignalObjectAndWait' needs this (targets Windows 2000 and above)
67 #define _WIN32_WINNT 0x0400
68 #include <windows.h>
69 #endif // !PLATFORM_XBOX
64 #include <process.h> 70 #include <process.h>
65 71
66 // MSDN: http://msdn2.microsoft.com/en-us/library/ms684254.aspx 72 // MSDN: http://msdn2.microsoft.com/en-us/library/ms684254.aspx
@@ -119,7 +125,7 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED };
119 // 125 //
120 #if defined( PLATFORM_OSX) 126 #if defined( PLATFORM_OSX)
121 #define YIELD() pthread_yield_np() 127 #define YIELD() pthread_yield_np()
122 #elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) 128 #elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) // no PTHREAD for PLATFORM_XBOX
123 // for some reason win32-pthread doesn't have pthread_yield(), but sched_yield() 129 // for some reason win32-pthread doesn't have pthread_yield(), but sched_yield()
124 #define YIELD() sched_yield() 130 #define YIELD() sched_yield()
125 #else 131 #else