[Base] Changed entry point to wmain for Windows

This prevents subapps from crashing when executing wmain specific functions
This commit is contained in:
Gliniak 2022-02-01 08:11:55 +01:00 committed by Rick Gibbed
parent 52ec0acd0c
commit 7977d7ab98
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,8 @@
#include "xenia/base/console_app_main.h"
#include "xenia/base/main_win.h"
int main(int argc_ignored, char** argv_ignored) {
// A wide character entry point is required for functions like _get_wpgmptr.
int wmain(int argc_ignored, wchar_t** argv_ignored) {
xe::ConsoleAppEntryInfo entry_info = xe::GetConsoleAppEntryInfo();
std::vector<std::string> args;

View File

@ -27,7 +27,7 @@ static bool has_shell_environment_variable() {
size_t size = 0;
// Check if SHELL exists
// If it doesn't, then we are in a Windows Terminal
auto error = getenv_s(&size, nullptr, 0, "SHELL");
auto error = _wgetenv_s(&size, nullptr, 0, L"SHELL");
if (error) {
return false;
}