From 8aebead754afd7b12e86dbb49703661b404cf4d2 Mon Sep 17 00:00:00 2001 From: Brian Callahan Date: Sat, 11 Jan 2020 00:06:29 -0500 Subject: [PATCH] Add OpenBSD support --- desktop_version/CONTRIBUTORS.txt | 1 + desktop_version/src/FileSystemUtils.cpp | 8 ++++---- desktop_version/src/SteamNetwork.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/desktop_version/CONTRIBUTORS.txt b/desktop_version/CONTRIBUTORS.txt index 882185c2..23f41400 100644 --- a/desktop_version/CONTRIBUTORS.txt +++ b/desktop_version/CONTRIBUTORS.txt @@ -4,6 +4,7 @@ Contributors (Ordered alphabetically by last name.) * Christoph Böhmwalder (@chrboe) +* Brian Callahan (@ibara) * Daniel Lee (@ddm999) * Elliott Saltar (@eboyblue3) * Marvin Scholz (@ePirat) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index ce703273..ef3250f4 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -15,7 +15,7 @@ #include #define mkdir(a, b) CreateDirectory(a, NULL) #define VNEEDS_MIGRATION (mkdirResult != 0) -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) #include #include #define VNEEDS_MIGRATION (mkdirResult == 0) @@ -159,7 +159,7 @@ std::vector FILESYSTEM_getLevelDirFileNames() void PLATFORM_getOSDirectory(char* output) { -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) strcpy(output, PHYSFS_getPrefDir("distractionware", "VVVVVV")); #elif defined(_WIN32) SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, output); @@ -174,7 +174,7 @@ void PLATFORM_migrateSaveData(char* output) char oldLocation[MAX_PATH]; char newLocation[MAX_PATH]; char oldDirectory[MAX_PATH]; -#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) DIR *dir = NULL; struct dirent *de = NULL; DIR *subDir = NULL; @@ -187,7 +187,7 @@ void PLATFORM_migrateSaveData(char* output) return; } strcpy(oldDirectory, homeDir); -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) strcat(oldDirectory, "/.vvvvvv/"); #elif defined(__APPLE__) strcat(oldDirectory, "/Documents/VVVVVV/"); diff --git a/desktop_version/src/SteamNetwork.c b/desktop_version/src/SteamNetwork.c index a1526cfa..5f06ffa6 100644 --- a/desktop_version/src/SteamNetwork.c +++ b/desktop_version/src/SteamNetwork.c @@ -15,7 +15,7 @@ #define NETWORK_LIBRARY "steam_api.dll" #elif defined(__APPLE__) #define NETWORK_LIBRARY "libsteam_api.dylib" -#elif defined(__linux__) || defined(__FreeBSD__) +#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) #define NETWORK_LIBRARY "libsteam_api.so" #else #error NETWORK_LIBRARY: Unrecognized platform! @@ -97,7 +97,7 @@ static void ClearPointers() int NETWORK_init() { -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) return 1; #endif intptr_t steamClient;