From 9f697af138a2ab1af16f2f2a1986a186e8422b81 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 3 Jan 2017 01:10:53 +0000 Subject: [PATCH] Win32: don't display dialogs for CRT assertions, like for aborts. Among other annoyances this causes our CI builds to hang infinitely without any indication in the console. --- src/platform/w32util.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platform/w32util.cpp b/src/platform/w32util.cpp index a38ab93..ef6936a 100644 --- a/src/platform/w32util.cpp +++ b/src/platform/w32util.cpp @@ -216,6 +216,11 @@ std::vector InitPlatform(int argc, char **argv) { // Don't display the abort message; it is aggravating in CLI binaries // and results in infinite WndProc recursion in GUI binaries. _set_abort_behavior(0, _WRITE_ABORT_MSG); + int crtReportTypes[] = {_CRT_WARN, _CRT_ERROR, _CRT_ASSERT}; + for(int crtReportType : crtReportTypes) { + _CrtSetReportMode(crtReportType, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(crtReportType, _CRTDBG_FILE_STDERR); + } #endif // Extract the command-line arguments; the ones from main() are ignored,