Skip to content

Commit

Permalink
msvc: avoid debug assertion windows in Debug Mode
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho committed Aug 23, 2018
1 parent 8a13c88 commit 48875c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,10 @@ static void maybe_redirect_std_handles(void)

#if defined(_MSC_VER)

#ifdef _DEBUG
#include <crtdbg.h>
#endif

/*
* This routine sits between wmain() and "main" in git.exe.
* We receive UNICODE (wchar_t) values for argv and env.
Expand All @@ -3110,6 +3114,10 @@ int msc_startup(int argc, wchar_t **w_argv, wchar_t **w_env)
int maxlen;
int k, exit_status;

#ifdef _DEBUG
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
#endif

#ifdef USE_MSVC_CRTDBG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
Expand Down

0 comments on commit 48875c5

Please sign in to comment.