mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 15:23:44 +02:00

Somehow, enabling LTO prevents these linker errors from showing up, which is why they don't show up in GitHub Actions, but that doesn't mean the errors can be ignored!
55 lines
1.4 KiB
Diff
55 lines
1.4 KiB
Diff
# Stops PhysFS from trying to get the base directory and user directory because it fails on Emscripten and on game consoles. Instead, we use sane defaults.
|
|
|
|
--- a/src/physfs.c
|
|
+++ b/src/physfs.c
|
|
@@ -1226,10 +1226,10 @@ int PHYSFS_init(const char *argv0)
|
|
|
|
if (!initializeMutexes()) goto initFailed;
|
|
|
|
- baseDir = calculateBaseDir(argv0);
|
|
+ baseDir = "/";
|
|
if (!baseDir) goto initFailed;
|
|
|
|
- userDir = __PHYSFS_platformCalcUserDir();
|
|
+ userDir = "/";
|
|
if (!userDir) goto initFailed;
|
|
|
|
/* Platform layer is required to append a dirsep. */
|
|
@@ -1367,13 +1367,11 @@ static int doDeinit(void)
|
|
|
|
if (baseDir != NULL)
|
|
{
|
|
- allocator.Free(baseDir);
|
|
baseDir = NULL;
|
|
} /* if */
|
|
|
|
if (userDir != NULL)
|
|
{
|
|
- allocator.Free(userDir);
|
|
userDir = NULL;
|
|
} /* if */
|
|
|
|
--- a/src/physfs_platform_posix.c
|
|
+++ b/src/physfs_platform_posix.c
|
|
@@ -109,8 +109,8 @@ char *__PHYSFS_platformCalcUserDir(void)
|
|
} /* if */
|
|
} /* if */
|
|
|
|
- if (retval == NULL)
|
|
- retval = getUserDirByUID();
|
|
+
|
|
+
|
|
|
|
return retval;
|
|
} /* __PHYSFS_platformCalcUserDir */
|
|
--- a/src/physfs_platform_unix.c
|
|
+++ b/src/physfs_platform_unix.c
|
|
@@ -227,7 +227,7 @@ static char *readSymLink(const char *path)
|
|
break; /* out of memory. */
|
|
retval = ptr;
|
|
|
|
- rc = readlink(path, retval, len);
|
|
+ rc = -1;
|
|
if (rc == -1)
|
|
break; /* not a symlink, i/o error, etc. */
|
|
|