Skip to content

Commit 246bc4e

Browse files
committed
Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents cedfaf7 + 184b33c commit 246bc4e

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
@@ -3062,6 +3062,10 @@ static void maybe_redirect_std_handles(void)
30623062

30633063
#if defined(_MSC_VER)
30643064

3065+
#ifdef _DEBUG
3066+
#include <crtdbg.h>
3067+
#endif
3068+
30653069
/*
30663070
* This routine sits between wmain() and "main" in git.exe.
30673071
* We receive UNICODE (wchar_t) values for argv and env.
@@ -3086,6 +3090,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
30863090
int maxlen;
30873091
int k, exit_status;
30883092

3093+
#ifdef _DEBUG
3094+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
3095+
#endif
3096+
30893097
#ifdef USE_MSVC_CRTDBG
30903098
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
30913099
#endif

0 commit comments

Comments
 (0)