From c4b1a9ba345950ec94526b51a06d1d37ff4f6ac0 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Sat, 16 Jun 2018 21:44:25 -0700 Subject: [PATCH] [Windows] Compile fixes with MinGW --- src/crashdump.cpp | 3 ++- src/mongoose/mongoose.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crashdump.cpp b/src/crashdump.cpp index b4e259b763..2e903becdc 100644 --- a/src/crashdump.cpp +++ b/src/crashdump.cpp @@ -119,8 +119,9 @@ init_crash_handler_os() // When the app crashes, don't print the abort message // and don't call Dr. Watson to make a crash dump. // http://msdn.microsoft.com/en-us/library/e631wekh(v=VS.100).aspx +#ifndef __MINGW32__ _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); - +#endif #if _MSC_VER >= 1400 _set_invalid_parameter_handler(invalid_parameter_handler); diff --git a/src/mongoose/mongoose.c b/src/mongoose/mongoose.c index 47685f434e..8076bf2864 100644 --- a/src/mongoose/mongoose.c +++ b/src/mongoose/mongoose.c @@ -139,10 +139,12 @@ typedef struct {HANDLE signal, broadcast;} pthread_cond_t; typedef DWORD pthread_t; #define pid_t HANDLE // MINGW typedefs pid_t to int. Using #define here. +#ifndef __MINGW32__ struct timespec { long tv_nsec; long tv_sec; }; +#endif static int pthread_mutex_lock(pthread_mutex_t *); static int pthread_mutex_unlock(pthread_mutex_t *);