From 9188bd23d3262fe6173f36aef74a130cd0aefa20 Mon Sep 17 00:00:00 2001 From: "striker.sh" Date: Sun, 13 Jun 2021 13:33:26 +0200 Subject: [PATCH] Support for OpenBSD - use fseeko and ftello like FreeBSD in tinyxml2 - use current directory as basePath if NULL (OpenBSD doesn't actually support this feature it is disabled via a patch in their ports) --- desktop_version/CONTRIBUTORS.txt | 1 + desktop_version/src/FileSystemUtils.cpp | 4 ++-- third_party/tinyxml2/tinyxml2.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop_version/CONTRIBUTORS.txt b/desktop_version/CONTRIBUTORS.txt index 4eeef7d0..ef98c555 100644 --- a/desktop_version/CONTRIBUTORS.txt +++ b/desktop_version/CONTRIBUTORS.txt @@ -25,6 +25,7 @@ Contributors * Thomas Sänger (@HorayNarea) * Info Teddy (@InfoTeddy) * Pierre-Alain TORET (@daftaupe) +* Jules de Sartiges (@strikersh) * leo60228 (@leo60228) * Emmanuel Vadot (@evadot) * Rémi Verschelde (@akien-mga) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 419cf834..06a4293f 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -148,8 +148,8 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath) if (basePath == NULL) { - puts("Unable to get base path!"); - return 0; + puts("Unable to determine base path, falling back to current directory"); + basePath = SDL_strdup("./"); } /* Mount the stock content last */ diff --git a/third_party/tinyxml2/tinyxml2.cpp b/third_party/tinyxml2/tinyxml2.cpp index 77b5cc4d..1606ce0a 100644 --- a/third_party/tinyxml2/tinyxml2.cpp +++ b/third_party/tinyxml2/tinyxml2.cpp @@ -103,7 +103,7 @@ distribution. #if defined(_WIN64) #define TIXML_FSEEK _fseeki64 #define TIXML_FTELL _ftelli64 -#elif defined(__APPLE__) || (__FreeBSD__) +#elif defined(__APPLE__) || (__FreeBSD__) || (__OpenBSD__) #define TIXML_FSEEK fseeko #define TIXML_FTELL ftello #elif defined(__unix__) && defined(__x86_64__)