add -console cmdline arg instead of #if 0/1

# Conflicts:
#	src/skel/glfw/glfw.cpp
#	src/skel/win/win.cpp
This commit is contained in:
withmorten 2020-11-28 17:57:10 +01:00 committed by Sergeanur
parent 8cb3c07151
commit b8d3d8f5e4
2 changed files with 17 additions and 11 deletions

View File

@ -1479,12 +1479,14 @@ WinMain(HINSTANCE instance,
RwChar** argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
#if 1
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
#ifndef MASTER
if (strstr(cmdLine, "-console"))
{
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
#endif
#else

View File

@ -2005,11 +2005,15 @@ WinMain(HINSTANCE instance,
RwChar **argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
#ifndef MASTER
if (strstr(cmdLine, "-console"))
{
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
#endif
/*
* Initialize the platform independent data.