mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 01:28:57 +00:00
windows: wrap all main funcs with utf8 conversions
fixes 12858
This commit is contained in:
parent
9af9e791f6
commit
a546c451b7
3 changed files with 59 additions and 16 deletions
|
@ -20,6 +20,10 @@ static int PrintUsage(int code)
|
|||
return code;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#define main app_main
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
|
@ -43,3 +47,18 @@ int main(int argc, char* argv[])
|
|||
|
||||
return command->Main(args);
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue