Merge pull request #1593 from Dune-jr/feature-noconsole

In release builds, disable Windows console by default. Closes #1583
This commit is contained in:
oy 2018-11-01 20:10:41 +01:00 committed by GitHub
commit be6afd0481
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2436,14 +2436,25 @@ void CClient::HandleTeeworldsConnectLink(const char *pConLink)
int main(int argc, const char **argv) // ignore_convention
{
#if defined(CONF_FAMILY_WINDOWS)
bool UseDefaultConsoleSettings = true;
for(int i = 1; i < argc; i++) // ignore_convention
{
#ifdef CONF_RELEASE
if(str_comp("-c", argv[i]) == 0 || str_comp("--console", argv[i]) == 0) // ignore_convention
#else
if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention
#endif
{
FreeConsole();
UseDefaultConsoleSettings = false;
break;
}
}
#ifdef CONF_RELEASE
if(!UseDefaultConsoleSettings)
#else
if(UseDefaultConsoleSettings)
#endif
FreeConsole();
#endif
bool UseDefaultConfig = false;