Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit 8692bbc

Browse files
alexcrichtonsaghul
authored andcommitted
windows: fix building on MinGW
The crtdbg.h header was added in c0716b3, but MinGW does not have this header present on the system. This commit takes the same approach of 2684f87 and just ignores this header and functionality on MinGW
1 parent a284b90 commit 8692bbc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/win/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#include <stdio.h>
2727
#include <stdlib.h>
2828
#include <string.h>
29+
#if !defined(__MINGW32__)
2930
#include <crtdbg.h>
31+
#endif
3032

3133
#include "uv.h"
3234
#include "internal.h"
@@ -42,7 +44,7 @@ static uv_once_t uv_init_guard_ = UV_ONCE_INIT;
4244
static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT;
4345

4446

45-
#ifdef _DEBUG
47+
#if defined(_DEBUG) && !defined(__MINGW32__)
4648
/* Our crt debug report handler allows us to temporarily disable asserts */
4749
/* just for the current thread. */
4850

@@ -89,7 +91,7 @@ static void uv_init(void) {
8991
/* We also need to setup our debug report handler because some CRT */
9092
/* functions (eg _get_osfhandle) raise an assert when called with invalid */
9193
/* FDs even though they return the proper error code in the release build. */
92-
#ifdef _DEBUG
94+
#if defined(_DEBUG) && !defined(__MINGW32__)
9395
_CrtSetReportHook(uv__crt_dbg_report_handler);
9496
#endif
9597

0 commit comments

Comments
 (0)