summaryrefslogtreecommitdiffhomepage
path: root/src/gameinfo.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-01-06 23:39:21 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2022-01-06 23:39:21 +0000
commit4ed68f73dae9e7621d7d7512b5feb686e9440bb2 (patch)
tree9646293b25a5a49b517d776baccce7ddff52a293 /src/gameinfo.c
parentc3ecdf5caf17825b047e4d8b5d979986cbe380b0 (diff)
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.
Diffstat (limited to 'src/gameinfo.c')
-rw-r--r--src/gameinfo.c9
1 files changed, 4 insertions, 5 deletions
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 <ctype.h>
-#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#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;