Skip to content

Commit 4a4e2e8

Browse files
committed
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 081971a commit 4a4e2e8

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
@@ -2975,6 +2975,10 @@ static char *wcstoutfdup_startup(char *buffer, const wchar_t *wcs, size_t len)
29752975

29762976
#if defined(_MSC_VER)
29772977

2978+
#ifdef _DEBUG
2979+
#include <crtdbg.h>
2980+
#endif
2981+
29782982
/*
29792983
* This routine sits between wmain() and "main" in git.exe.
29802984
* We receive UNICODE (wchar_t) values for argv and env.
@@ -2999,6 +3003,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
29993003
int maxlen;
30003004
int k, x;
30013005

3006+
#ifdef _DEBUG
3007+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
3008+
#endif
3009+
30023010
#ifdef USE_MSVC_CRTDBG
30033011
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
30043012
#endif

0 commit comments

Comments
 (0)