diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2017-03-28 09:17:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-28 09:17:02 -0700 |
| commit | cdd3ac023ca850fcb68e67358ce7ef38c1f39d22 (patch) | |
| tree | 37085eac7e4f1ed2493f0cfaad48c964d2950569 /Source | |
| parent | 2c531889b26da2ac3fa7a046e988c15fe2e043b2 (diff) | |
| parent | c1cd7d9c0ea54cc2d11b27ee9f207f04bbcd75cc (diff) | |
Merge pull request #5133 from leoetlino/ugh-windows
Fix issues introduced by cpp-optparse on Windows
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/Main.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 934697ddab..91133a4e57 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -91,7 +91,6 @@ bool DolphinApp::OnCmdLineParsed(wxCmdLineParser& parser) bool DolphinApp::OnInit() { - std::lock_guard<std::mutex> lk(s_init_mutex); if (!wxApp::OnInit()) return false; @@ -108,8 +107,20 @@ 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); + UICommon::SetUserDirectory(m_user_path.ToStdString()); UICommon::CreateDirectories(); InitLanguageSupport(); // The language setting is loaded from the user directory |
