summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-31 22:02:42 +0200
committerAndreas Baumann <abaumann@yahoo.com>2009-03-31 22:02:42 +0200
commit41cb2efe1bceb9eef88f0010358b7712c1ad7c59 (patch)
tree2824923804841d87a66be4e6398a4bd89921b524 /include
parent0ff770d78ea31b332bde745404e29db71ab8d18c (diff)
downloadwolfbones-41cb2efe1bceb9eef88f0010358b7712c1ad7c59.tar.gz
wolfbones-41cb2efe1bceb9eef88f0010358b7712c1ad7c59.tar.bz2
fixed threading on native Windows
Diffstat (limited to 'include')
-rw-r--r--include/wolf/threads/mutex.h1
-rw-r--r--include/wolf/threads/threads.h11
2 files changed, 10 insertions, 2 deletions
diff --git a/include/wolf/threads/mutex.h b/include/wolf/threads/mutex.h
index fd01b36..9cfc777 100644
--- a/include/wolf/threads/mutex.h
+++ b/include/wolf/threads/mutex.h
@@ -65,6 +65,7 @@ static INLINE void wolf_mutex_unlock( wolf_mutex_t *mutex ) {
#ifdef _WIN32
+#define WIND32_LEAN_AND_MEAN
#include <windows.h>
typedef CRITICAL_SECTION wolf_mutex_t;
diff --git a/include/wolf/threads/threads.h b/include/wolf/threads/threads.h
index ff1e645..38449d3 100644
--- a/include/wolf/threads/threads.h
+++ b/include/wolf/threads/threads.h
@@ -41,6 +41,9 @@ extern "C" {
#include <pthread.h> /* for thread functions */
+#define WOLF_THREAD_RETURN_DECL void *
+#define WOLF_THREAD_RETURN return NULL;
+
typedef pthread_t wolf_thread_t;
typedef void *( *wolf_thread_func_t )( void * );
@@ -52,11 +55,15 @@ wolf_error_t wolf_thread_join( wolf_thread_t *thread );
#ifdef _WIN32
+#define WIND32_LEAN_AND_MEAN
#include <windows.h>
-typedef HANDLE wolf_thread_t;
+#define WOLF_THREAD_RETURN_DECL unsigned
+#define WOLF_THREAD_RETURN return 0;
+
+typedef uintptr_t wolf_thread_t;
-typedef LPTHREAD_START_ROUTINE wolf_thread_func_t;
+typedef void ( *wolf_thread_func_t )( void * );
wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func );
wolf_error_t wolf_thread_join( wolf_thread_t *thread );