diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2022-03-08 01:54:41 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-08 01:54:41 -0600 |
| commit | 58c02e6b8585e0764643853f8e255b5013978469 (patch) | |
| tree | 4376a97cc79925e3b5b737437cc641f16e2fc089 /Source/Core/DolphinNoGUI/MainNoGUI.cpp | |
| parent | 9af9e791f6a19d62197ad0d2e0fc39ed744cd506 (diff) | |
| parent | a546c451b7a665e9e9a74719164cc435033225b1 (diff) | |
Merge pull request #10500 from shuffle2/master
windows: wrap all main funcs with utf8 conversions
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinNoGUI/MainNoGUI.cpp | 19 |
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 |
