From 8692bbc254b89ef4ccd1a9bf7be9a1bc8bc6eb5f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 15 Feb 2014 22:16:59 -0800 Subject: [PATCH] windows: fix building on MinGW The crtdbg.h header was added in c0716b3d, but MinGW does not have this header present on the system. This commit takes the same approach of 2684f876a and just ignores this header and functionality on MinGW --- src/win/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/win/core.c b/src/win/core.c index e1a77655..f2ffd7b0 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -26,7 +26,9 @@ #include #include #include +#if !defined(__MINGW32__) #include +#endif #include "uv.h" #include "internal.h" @@ -42,7 +44,7 @@ static uv_once_t uv_init_guard_ = UV_ONCE_INIT; static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT; -#ifdef _DEBUG +#if defined(_DEBUG) && !defined(__MINGW32__) /* Our crt debug report handler allows us to temporarily disable asserts */ /* just for the current thread. */ @@ -89,7 +91,7 @@ static void uv_init(void) { /* We also need to setup our debug report handler because some CRT */ /* functions (eg _get_osfhandle) raise an assert when called with invalid */ /* FDs even though they return the proper error code in the release build. */ -#ifdef _DEBUG +#if defined(_DEBUG) && !defined(__MINGW32__) _CrtSetReportHook(uv__crt_dbg_report_handler); #endif