]> git.ipfire.org Git - thirdparty/git.git/commitdiff
msvc: avoid debug assertion windows in Debug Mode
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 25 Jun 2019 14:49:42 +0000 (07:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Jun 2019 17:46:58 +0000 (10:46 -0700)
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c

index d01e88c2f80e022c87f9afde65d3703e36f5c73d..433838391fd95d6c89279561df63176f31d77b27 100644 (file)
@@ -2437,6 +2437,10 @@ int wmain(int argc, const wchar_t **wargv)
        trace2_initialize_clock();
 
 #ifdef _MSC_VER
+#ifdef _DEBUG
+       _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
+#endif
+
 #ifdef USE_MSVC_CRTDBG
        _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 #endif