From 4ed68f73dae9e7621d7d7512b5feb686e9440bb2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 6 Jan 2022 23:39:21 +0000 Subject: Tidy up stubs, make vstdlib a stub, build on Linux Important note: it doesn't WORK on Linux, and there's tons of warnings and stuff, but it's easier to work on when all the compiler output and whatnot is there. --- src/gameinfo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gameinfo.c') diff --git a/src/gameinfo.c b/src/gameinfo.c index 32f5051..de5fafc 100644 --- a/src/gameinfo.c +++ b/src/gameinfo.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #ifdef _WIN32 @@ -49,9 +48,9 @@ const os_char *gameinfo_serverlib = _gameinfo_serverlib; // magical argc/argv grabber so we don't have to go through procfs #ifdef __linux__ -static const char *prog_argv; +static const char *const *prog_argv; static int storeargs(int argc, char *argv[]) { - prog_argv = argv; + prog_argv = (const char *const *)argv; return 0; } __attribute__((used, section(".init_array"))) @@ -116,7 +115,7 @@ static inline void do_gamelib_search(const char *p, uint len, bool isgamebin) { api_needs_null_term[len] = L'\0'; if (!PathIsRelativeA(api_needs_null_term)) #else - if (*p == "/") // so much easier :') + if (*p == '/') // so much easier :') #endif { // the mod path is absolute, so we're not sticking anything else in @@ -313,7 +312,7 @@ bool gameinfo_init(void) { // also do the executable name check just for portal2_linux if (!strcmp(exename, "portal2_linux")) modname = "portal2"; // ah, the sane, straightforward world of unix command line arguments :) - for (char **pp = prog_argv + 1; *pp; ++pp) { + for (const char *const *pp = prog_argv + 1; *pp; ++pp) { if (!strcmp(*pp, "-game")) { if (!*++pp) break; modname = *pp; -- cgit v1.2.3