Skip to content

Commit ad6db30

Browse files
dschoGit for Windows Build Agent
authored andcommitted
msvc: avoid debug assertion windows in Debug Mode
For regular debugging, it is pretty helpful when a debug assertion in a running application triggers a window that offers to start the debugger. However, when running the test suite, it is not so helpful, in particular when the debug assertions are then suppressed anyway because we disable the invalid parameter checking (via invalidcontinue.obj, see the comment in config.mak.uname about that object for more information). So let's simply disable that window in Debug Mode (it is already disabled in Release Mode). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b2ac237 commit ad6db30

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

30873087
#if defined(_MSC_VER)
30883088

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

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

0 commit comments

Comments
 (0)