diff options
| author | 2016-06-08 13:53:41 +0800 | |
|---|---|---|
| committer | 2016-06-08 13:53:41 +0800 | |
| commit | f9e3824820b92b886dd072f396dee2221daabb20 (patch) | |
| tree | af28053418a5122b3c813e2269bcbf50bc5b5198 /src | |
| parent | Merge pull request #1873 from archshift/remove-config (diff) | |
| download | yuzu-f9e3824820b92b886dd072f396dee2221daabb20.tar.gz yuzu-f9e3824820b92b886dd072f396dee2221daabb20.tar.xz yuzu-f9e3824820b92b886dd072f396dee2221daabb20.zip | |
Fix boot_filename encode on Windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra/citra.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index e01216734..128b9a16d 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -17,11 +17,16 @@ | |||
| 17 | #include <getopt.h> | 17 | #include <getopt.h> |
| 18 | #endif | 18 | #endif |
| 19 | 19 | ||
| 20 | #ifdef _WIN32 | ||
| 21 | #include <Windows.h> | ||
| 22 | #endif | ||
| 23 | |||
| 20 | #include "common/logging/log.h" | 24 | #include "common/logging/log.h" |
| 21 | #include "common/logging/backend.h" | 25 | #include "common/logging/backend.h" |
| 22 | #include "common/logging/filter.h" | 26 | #include "common/logging/filter.h" |
| 23 | #include "common/scm_rev.h" | 27 | #include "common/scm_rev.h" |
| 24 | #include "common/scope_exit.h" | 28 | #include "common/scope_exit.h" |
| 29 | #include "common/string_util.h" | ||
| 25 | 30 | ||
| 26 | #include "core/settings.h" | 31 | #include "core/settings.h" |
| 27 | #include "core/system.h" | 32 | #include "core/system.h" |
| @@ -55,6 +60,15 @@ int main(int argc, char **argv) { | |||
| 55 | bool use_gdbstub = Settings::values.use_gdbstub; | 60 | bool use_gdbstub = Settings::values.use_gdbstub; |
| 56 | u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port); | 61 | u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port); |
| 57 | char *endarg; | 62 | char *endarg; |
| 63 | #ifdef _WIN32 | ||
| 64 | int argc_w; | ||
| 65 | auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); | ||
| 66 | |||
| 67 | if (argv_w == nullptr) { | ||
| 68 | LOG_CRITICAL(Frontend, "Failed to get command line arguments"); | ||
| 69 | return -1; | ||
| 70 | } | ||
| 71 | #endif | ||
| 58 | std::string boot_filename; | 72 | std::string boot_filename; |
| 59 | 73 | ||
| 60 | static struct option long_options[] = { | 74 | static struct option long_options[] = { |
| @@ -86,11 +100,19 @@ int main(int argc, char **argv) { | |||
| 86 | return 0; | 100 | return 0; |
| 87 | } | 101 | } |
| 88 | } else { | 102 | } else { |
| 103 | #ifdef _WIN32 | ||
| 104 | boot_filename = Common::UTF16ToUTF8(argv_w[optind]); | ||
| 105 | #else | ||
| 89 | boot_filename = argv[optind]; | 106 | boot_filename = argv[optind]; |
| 107 | #endif | ||
| 90 | optind++; | 108 | optind++; |
| 91 | } | 109 | } |
| 92 | } | 110 | } |
| 93 | 111 | ||
| 112 | #ifdef _WIN32 | ||
| 113 | LocalFree(argv_w); | ||
| 114 | #endif | ||
| 115 | |||
| 94 | Log::Filter log_filter(Log::Level::Debug); | 116 | Log::Filter log_filter(Log::Level::Debug); |
| 95 | Log::SetFilter(&log_filter); | 117 | Log::SetFilter(&log_filter); |
| 96 | 118 | ||