Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan C. Gordon bfa7997c67
unix: Better base dir calculation for Solaris.
This idea came from https://github.com/libsdl-org/SDL/pull/6681 (thanks!)

(cherry picked from commit 9266e773d3)
2022-11-27 21:46:12 -05:00
Ryan C. Gordon eb3383b532
Bumped version to 3.2.0! 2022-09-30 16:13:07 -04:00
5 changed files with 14 additions and 10 deletions

View File

@ -9,7 +9,7 @@
# compile, using preprocessor checks for platform-specific bits instead of
# testing in here.
set(PHYSFS_VERSION 3.1.0)
set(PHYSFS_VERSION 3.2.0)
cmake_minimum_required(VERSION 3.0)

View File

@ -2,7 +2,7 @@
# wmake -f Makefile.os2
LIBNAME = physfs
VERSION = 3.1.0
VERSION = 3.2.0
LIBFILE = $(LIBNAME).lib
DLLFILE = $(LIBNAME).dll

View File

@ -435,7 +435,7 @@ typedef struct PHYSFS_Version
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#define PHYSFS_VER_MAJOR 3
#define PHYSFS_VER_MINOR 1
#define PHYSFS_VER_MINOR 2
#define PHYSFS_VER_PATCH 0
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */

View File

@ -261,12 +261,6 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
if (sysctl(mib, 4, fullpath, &buflen, NULL, 0) != -1)
retval = __PHYSFS_strdup(fullpath);
}
#elif defined(PHYSFS_PLATFORM_SOLARIS)
{
const char *path = getexecname();
if ((path != NULL) && (path[0] == '/')) /* must be absolute path... */
retval = __PHYSFS_strdup(path);
}
#endif
/* If there's a Linux-like /proc filesystem, you can get the full path to
@ -278,6 +272,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
retval = readSymLink("/proc/self/exe");
if (!retval) retval = readSymLink("/proc/curproc/file");
if (!retval) retval = readSymLink("/proc/curproc/exe");
if (!retval) retval = readSymLink("/proc/self/path/a.out");
if (retval == NULL)
{
/* older kernels don't have /proc/self ... try PID version... */
@ -289,6 +284,15 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
} /* if */
} /* if */
#if defined(PHYSFS_PLATFORM_SOLARIS)
if (!retval) /* try getexecname() if /proc didn't pan out. This may not be an absolute path! */
{
const char *path = getexecname();
if ((path != NULL) && (path[0] == '/')) /* must be absolute path... */
retval = __PHYSFS_strdup(path);
} /* if */
#endif
if (retval != NULL) /* chop off filename. */
{
char *ptr = strrchr(retval, '/');

View File

@ -31,7 +31,7 @@
#include "physfs.h"
#define TEST_VERSION_MAJOR 3
#define TEST_VERSION_MINOR 1
#define TEST_VERSION_MINOR 2
#define TEST_VERSION_PATCH 0
static FILE *history_file = NULL;