From: Junio C Hamano Date: Fri, 4 Mar 2016 21:46:39 +0000 (-0800) Subject: Merge branch 'js/pthread-exit-emu-windows' X-Git-Tag: v2.8.0-rc1~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3978cd06ffcb62ed94e3b3efcc086f8ed623680f?ds=inline;hp=-c Merge branch 'js/pthread-exit-emu-windows' * js/pthread-exit-emu-windows: Mark win32's pthread_exit() as NORETURN --- 3978cd06ffcb62ed94e3b3efcc086f8ed623680f diff --combined compat/win32/pthread.h index 20b35a283c,799ecf00bc..b6ed9e7462 --- a/compat/win32/pthread.h +++ b/compat/win32/pthread.h @@@ -18,10 -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 @@@ -78,9 -75,9 +78,9 @@@ extern int win32_pthread_join(pthread_ #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;