summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinNoGUI/MainNoGUI.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2022-03-07 23:22:35 -0800
committerShawn Hoffman <godisgovernment@gmail.com>2022-03-07 23:24:21 -0800
commita546c451b7a665e9e9a74719164cc435033225b1 (patch)
tree4376a97cc79925e3b5b737437cc641f16e2fc089 /Source/Core/DolphinNoGUI/MainNoGUI.cpp
parent9af9e791f6a19d62197ad0d2e0fc39ed744cd506 (diff)
windows: wrap all main funcs with utf8 conversions
fixes 12858
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index f439130441..185bc447d9 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -149,6 +149,10 @@ static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
return nullptr;
}
+#ifdef _WIN32
+#define main app_main
+#endif
+
int main(int argc, char* argv[])
{
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions);
@@ -275,3 +279,18 @@ int main(int argc, char* argv[])
return 0;
}
+
+#ifdef _WIN32
+int wmain(int, wchar_t*[], wchar_t*[])
+{
+ std::vector<std::string> args = CommandLineToUtf8Argv(GetCommandLineW());
+ const int argc = static_cast<int>(args.size());
+ std::vector<char*> argv(args.size());
+ for (size_t i = 0; i < args.size(); ++i)
+ argv[i] = args[i].data();
+
+ return main(argc, argv.data());
+}
+
+#undef main
+#endif