attach to console if present, spawn our own otherwise

This commit is contained in:
radius 2017-02-15 22:25:17 -05:00
parent 4db257c104
commit 742e45c6eb

View File

@ -345,13 +345,12 @@ static void frontend_win32_attach_console(void)
{
#ifdef _WIN32
#ifdef _WIN32_WINNT_WINXP
if (!AttachConsole(ATTACH_PARENT_PROCESS))
{
AllocConsole();
AttachConsole( GetCurrentProcessId()) ;
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
}
AttachConsole(ATTACH_PARENT_PROCESS);
AllocConsole();
AttachConsole( GetCurrentProcessId()) ;
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif
#endif
}