From 100c043599187289f821184e45a4bdf13ec9411d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 13 Mar 2024 15:49:24 +0100 Subject: [PATCH] Codechange: [Win32] Disable assert message box when no GUI (#12291) --- src/video/dedicated_v.cpp | 2 ++ src/video/null_v.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index e2613f2313..c56896eb8a 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -126,6 +126,8 @@ const char *VideoDriver_Dedicated::Start(const StringList &) #ifdef _MSC_VER /* Disable the MSVC assertion message box. */ _set_error_mode(_OUT_TO_STDERR); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); #endif Debug(driver, 1, "Loading dedicated server"); diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index f0551e8898..c1e2c5396b 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -24,6 +24,8 @@ const char *VideoDriver_Null::Start(const StringList &parm) #ifdef _MSC_VER /* Disable the MSVC assertion message box. */ _set_error_mode(_OUT_TO_STDERR); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); #endif this->UpdateAutoResolution();