Skip to content

Commit f471c7b

Browse files
committed
Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents e99f9eb + 0e32c51 commit f471c7b

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

30883088
#if defined(_MSC_VER)
30893089

3090+
#ifdef _DEBUG
3091+
#include <crtdbg.h>
3092+
#endif
3093+
30903094
/*
30913095
* This routine sits between wmain() and "main" in git.exe.
30923096
* We receive UNICODE (wchar_t) values for argv and env.
@@ -3111,6 +3115,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
31113115
int maxlen;
31123116
int k, exit_status;
31133117

3118+
#ifdef _DEBUG
3119+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
3120+
#endif
3121+
31143122
#ifdef USE_MSVC_CRTDBG
31153123
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
31163124
#endif

0 commit comments

Comments
 (0)