Skip to content

Commit d9797d5

Browse files
committed
Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents f81edb6 + 00dd780 commit d9797d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compat/mingw.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,10 @@ static void maybe_redirect_std_handles(void)
30333033

30343034
#if defined(_MSC_VER)
30353035

3036+
#ifdef _DEBUG
3037+
#include <crtdbg.h>
3038+
#endif
3039+
30363040
/*
30373041
* This routine sits between wmain() and "main" in git.exe.
30383042
* We receive UNICODE (wchar_t) values for argv and env.
@@ -3057,6 +3061,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
30573061
int maxlen;
30583062
int k, exit_status;
30593063

3064+
#ifdef _DEBUG
3065+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
3066+
#endif
3067+
30603068
#ifdef USE_MSVC_CRTDBG
30613069
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
30623070
#endif

0 commit comments

Comments
 (0)