Skip to content

Commit 3810c5d

Browse files
committed
Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 4498404 + 4a38a01 commit 3810c5d

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

30773077
#if defined(_MSC_VER)
30783078

3079+
#ifdef _DEBUG
3080+
#include <crtdbg.h>
3081+
#endif
3082+
30793083
/*
30803084
* This routine sits between wmain() and "main" in git.exe.
30813085
* We receive UNICODE (wchar_t) values for argv and env.
@@ -3100,6 +3104,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
31003104
int maxlen;
31013105
int k, exit_status;
31023106

3107+
#ifdef _DEBUG
3108+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
3109+
#endif
3110+
31033111
#ifdef USE_MSVC_CRTDBG
31043112
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
31053113
#endif

0 commit comments

Comments
 (0)