Core/Misc: Fix *BSD compile errors (#28287)

(cherry picked from commit 2b8fc95fde)
This commit is contained in:
Lloyd Dilley
2022-10-01 11:17:46 -04:00
committed by Shauren
parent a489ea6dd6
commit 1c36441b7c
4 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp
index 06e6ff00a5e3..0898af795348 100644
--- a/dep/g3dlite/source/FileSystem.cpp
+++ b/dep/g3dlite/source/FileSystem.cpp
@@ -35,6 +35,9 @@
# include <fnmatch.h>
# include <unistd.h>
# define _getcwd getcwd
+# if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# define stat64 stat
+# endif
# define _stat stat
# define stricmp strcasecmp
# define strnicmp strncasecmp

View File

@@ -35,6 +35,9 @@
# include <fnmatch.h>
# include <unistd.h>
# define _getcwd getcwd
# if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# define stat64 stat
# endif
# define _stat stat
# define stricmp strcasecmp
# define strnicmp strncasecmp

View File

@@ -74,6 +74,8 @@ time_t LocalTimeToUTCTime(time_t time)
{
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
return time + _timezone;
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
return timegm(gmtime(&time));
#else
return time + timezone;
#endif

View File

@@ -475,7 +475,7 @@ int main(int argc, char ** argv)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// Create the working directory
if (mkdir(szWorkDirWmo
#if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
, 0711
#endif
))