Merge branch 'mg/work-tree-tests'
[gitweb.git] / compat / win32 / pthread.h
index 8ad187344fd93e894a2f1cbfaa0fb59fd832de5b..20b35a283ca71070086728384fffadf98aa17bba 100644 (file)
  */
 #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;