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);