WX: Redirect stdout to console output
Thank Windows for its default console handling. This fixes std::cout not working on Windows.
This commit is contained in:
parent
77b389bf99
commit
c1cd7d9c0e
|
@ -107,6 +107,16 @@ bool DolphinApp::OnInit()
|
|||
wxHandleFatalExceptions(true);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
const bool console_attached = AttachConsole(ATTACH_PARENT_PROCESS) != FALSE;
|
||||
HANDLE stdout_handle = ::GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (console_attached && stdout_handle)
|
||||
{
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
ParseCommandLine();
|
||||
|
||||
std::lock_guard<std::mutex> lk(s_init_mutex);
|
||||
|
|
Loading…
Reference in New Issue