Windows: Redirect stderr to console

So that WARNING messages are printed on the console.
This commit is contained in:
kichikuou
2024-12-04 11:43:59 +09:00
parent bc8a85e046
commit 8219feee6d
+1
View File
@@ -36,6 +36,7 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) {
void win_alloc_console(void) {
AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
freopen("CONIN$", "r", stdin);
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);