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
This commit is contained in:
Alex Crichton 2014-02-15 22:16:59 -08:00 committed by Saúl Ibarra Corretgé
parent a284b90c03
commit 8692bbc254

View File

@ -26,7 +26,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !defined(__MINGW32__)
#include <crtdbg.h>
#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