Skip to content

Commit a7b5734

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 5d3ca0a commit a7b5734

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
@@ -2421,6 +2421,10 @@ static void maybe_redirect_std_handles(void)
24212421
#endif
24222422
#endif
24232423

2424+
#ifdef _DEBUG
2425+
#include <crtdbg.h>
2426+
#endif
2427+
24242428
/*
24252429
* We implement wmain() and compile with -municode, which would
24262430
* normally ignore main(), but we call the latter from the former
@@ -2437,6 +2441,10 @@ int wmain(int argc, const wchar_t **wargv)
24372441
const char **argv;
24382442

24392443
#ifdef _MSC_VER
2444+
#ifdef _DEBUG
2445+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
2446+
#endif
2447+
24402448
#ifdef USE_MSVC_CRTDBG
24412449
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
24422450
#endif

0 commit comments

Comments
 (0)