From 699d8c45909d2bf48d38895237bf20fcf11accdf Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Fri, 10 Jan 2020 22:37:26 +0100 Subject: [PATCH] FreeBSD: Use the same path as Linux Since FreeBSD is unix based we also use the concept of $HOME. Use the same include and code as Linux. Signed-off-by: Emmanuel Vadot --- desktop_version/src/FileSystemUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 40e54da9..b024244a 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__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) #include #include #define VNEEDS_MIGRATION (mkdirResult == 0) @@ -159,7 +159,7 @@ std::vector FILESYSTEM_getLevelDirFileNames() void PLATFORM_getOSDirectory(char* output) { -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) const char *homeDir = getenv("XDG_DATA_HOME"); if (homeDir == NULL) { @@ -187,7 +187,7 @@ void PLATFORM_migrateSaveData(char* output) char oldLocation[MAX_PATH]; char newLocation[MAX_PATH]; char oldDirectory[MAX_PATH]; -#if defined(__linux__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) DIR *dir = NULL; struct dirent *de = NULL; DIR *subDir = NULL; @@ -200,7 +200,7 @@ void PLATFORM_migrateSaveData(char* output) return; } strcpy(oldDirectory, homeDir); -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) strcat(oldDirectory, "/.vvvvvv/"); #elif defined(__APPLE__) strcat(oldDirectory, "/Documents/VVVVVV/");