Merge branch 'jc/doc-lint'
[gitweb.git] / compat / win32 / pthread.h
index e74157cd4d04d304b96fe88a70804b240f798b1c..1c164088fbb64d2f0143f536f3186f481d876d28 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
@@ -75,9 +78,9 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);
 #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)
 extern pthread_t pthread_self(void);
 
-static inline int pthread_exit(void *ret)
+static inline void NORETURN pthread_exit(void *ret)
 {
-       ExitThread((DWORD)ret);
+       ExitThread((DWORD)(intptr_t)ret);
 }
 
 typedef DWORD pthread_key_t;
@@ -101,9 +104,11 @@ static inline void *pthread_getspecific(pthread_key_t key)
        return TlsGetValue(key);
 }
 
+#ifndef __MINGW64_VERSION_MAJOR
 static inline int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
 {
        return 0;
 }
+#endif
 
 #endif /* PTHREAD_H */