Merge pull request #3791 from fr500/master

use existing console if available
This commit is contained in:
Twinaphex 2016-10-14 09:16:59 +02:00 committed by GitHub
commit 915aa7e8f1

View File

@ -323,8 +323,11 @@ static uint64_t frontend_win32_get_mem_used(void)
static void frontend_win32_attach_console(void)
{
#ifdef _WIN32
AllocConsole();
AttachConsole( GetCurrentProcessId()) ;
if (!AttachConsole(ATTACH_PARENT_PROCESS))
{
AllocConsole();
AttachConsole( GetCurrentProcessId()) ;
}
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif