Played with making xenia-run a Win32 app, but then logging stops working...

This commit is contained in:
Ben Vanik
2014-01-15 21:58:09 -08:00
parent df90707fe3
commit ffcd687ef6
6 changed files with 39 additions and 2 deletions

View File

@@ -18,11 +18,14 @@ namespace {
typedef int (*user_main_t)(int argc, xechar_t** argv);
}
} // namespace
#if XE_LIKE_WIN32 && defined(UNICODE) && UNICODE
#include <windows.h>
#include <shellapi.h>
int xe_main_thunk(
int argc, wchar_t* argv[],
void* user_main, const char* usage) {
@@ -53,6 +56,23 @@ int xe_main_thunk(
return result;
}
int xe_main_window_thunk(
wchar_t* command_line,
void* user_main, const wchar_t* name, const char* usage) {
wchar_t buffer[2048];
xestrcpy(buffer, XECOUNT(buffer), name);
xestrcat(buffer, XECOUNT(buffer), XETEXT(" "));
xestrcat(buffer, XECOUNT(buffer), command_line);
int argc;
wchar_t** argv = CommandLineToArgvW(buffer, &argc);
if (!argv) {
return 1;
}
int result = xe_main_thunk(argc, argv, user_main, usage);
LocalFree(argv);
return result;
}
#else
int xe_main_thunk(