From 0797f7382bd44861cc8037444b7685fee08db006 Mon Sep 17 00:00:00 2001 From: NeroBurner Date: Fri, 1 Sep 2017 10:40:46 +0200 Subject: [PATCH] mingw-w64: fix port.h pthread recreation --- src/windows/port.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/windows/port.h b/src/windows/port.h index 8198461..7928ff4 100755 --- a/src/windows/port.h +++ b/src/windows/port.h @@ -136,19 +136,21 @@ typedef int pid_t; #endif // _MSC_VER // ----------------------------------- THREADS -#ifndef __MINGW32__ +#if defined(HAVE_PTHREAD) +# include +#else // no PTHREAD typedef DWORD pthread_t; typedef DWORD pthread_key_t; typedef LONG pthread_once_t; enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock #define pthread_self GetCurrentThreadId #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2)) +#endif // HAVE_PTHREAD inline struct tm* localtime_r(const time_t* timep, struct tm* result) { localtime_s(result, timep); return result; } -#endif inline char* strerror_r(int errnum, char* buf, size_t buflen) { strerror_s(buf, buflen, errnum);