summaryrefslogtreecommitdiff
path: root/compat/win32/pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/win32/pthread.h')
-rw-r--r--compat/win32/pthread.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index 8ad1873..20b35a2 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -18,7 +18,10 @@
*/
#define pthread_mutex_t CRITICAL_SECTION
-#define pthread_mutex_init(a,b) (InitializeCriticalSection((a)), 0)
+static inline int return_0(int i) {
+ return 0;
+}
+#define pthread_mutex_init(a,b) return_0((InitializeCriticalSection((a)), 0))
#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
#define pthread_mutex_lock EnterCriticalSection
#define pthread_mutex_unlock LeaveCriticalSection
@@ -77,7 +80,7 @@ extern pthread_t pthread_self(void);
static inline int pthread_exit(void *ret)
{
- ExitThread((DWORD)ret);
+ ExitThread((DWORD)(intptr_t)ret);
}
typedef DWORD pthread_key_t;