mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu.git
				synced 2025-05-12 00:45:25 +00:00 
			
		
		
		
	Merge pull request #1890 from LFsWang/fix-encode-problem
Fix boot_filename encode on Windows
This commit is contained in:
		
						commit
						f95d119dde
					
				@ -17,11 +17,16 @@
 | 
				
			|||||||
#include <getopt.h>
 | 
					#include <getopt.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
					#include <Windows.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "common/logging/log.h"
 | 
					#include "common/logging/log.h"
 | 
				
			||||||
#include "common/logging/backend.h"
 | 
					#include "common/logging/backend.h"
 | 
				
			||||||
#include "common/logging/filter.h"
 | 
					#include "common/logging/filter.h"
 | 
				
			||||||
#include "common/scm_rev.h"
 | 
					#include "common/scm_rev.h"
 | 
				
			||||||
#include "common/scope_exit.h"
 | 
					#include "common/scope_exit.h"
 | 
				
			||||||
 | 
					#include "common/string_util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings.h"
 | 
					#include "core/settings.h"
 | 
				
			||||||
#include "core/system.h"
 | 
					#include "core/system.h"
 | 
				
			||||||
@ -55,6 +60,15 @@ int main(int argc, char **argv) {
 | 
				
			|||||||
    bool use_gdbstub = Settings::values.use_gdbstub;
 | 
					    bool use_gdbstub = Settings::values.use_gdbstub;
 | 
				
			||||||
    u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port);
 | 
					    u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port);
 | 
				
			||||||
    char *endarg;
 | 
					    char *endarg;
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
					    int argc_w;
 | 
				
			||||||
 | 
					    auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (argv_w == nullptr) {
 | 
				
			||||||
 | 
					        LOG_CRITICAL(Frontend, "Failed to get command line arguments");
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    std::string boot_filename;
 | 
					    std::string boot_filename;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static struct option long_options[] = {
 | 
					    static struct option long_options[] = {
 | 
				
			||||||
@ -86,11 +100,19 @@ int main(int argc, char **argv) {
 | 
				
			|||||||
                return 0;
 | 
					                return 0;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
					            boot_filename = Common::UTF16ToUTF8(argv_w[optind]);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
            boot_filename = argv[optind];
 | 
					            boot_filename = argv[optind];
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
            optind++;
 | 
					            optind++;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
					    LocalFree(argv_w);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Log::Filter log_filter(Log::Level::Debug);
 | 
					    Log::Filter log_filter(Log::Level::Debug);
 | 
				
			||||||
    Log::SetFilter(&log_filter);
 | 
					    Log::SetFilter(&log_filter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user