Commit 0797f738 authored by NeroBurner's avatar NeroBurner Committed by NeroBurner

mingw-w64: fix port.h pthread recreation

parent d354e2e8
......@@ -136,19 +136,21 @@ typedef int pid_t;
#endif // _MSC_VER
// ----------------------------------- THREADS
#ifndef __MINGW32__
#if defined(HAVE_PTHREAD)
# include <pthread.h>
#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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment