mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
Fix building on FreeBSD
This commit is contained in:
committed by
Michał Janiszewski
parent
9b25a45e90
commit
04ed2d78d2
@@ -14,7 +14,7 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#if (defined(__linux__) || defined(__OpenBSD__)) && !defined(__ANDROID__)
|
||||
#if (defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <sstream>
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
return _ftelli64(_file);
|
||||
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__ANDROID__) || defined(__OpenBSD__)
|
||||
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__ANDROID__) || defined(__OpenBSD__) || defined(__FreeBSD__)
|
||||
return ftello(_file);
|
||||
#else
|
||||
return ftello64(_file);
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
_fseeki64(_file, offset, SEEK_END);
|
||||
break;
|
||||
}
|
||||
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__ANDROID__) || defined(__OpenBSD__)
|
||||
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__ANDROID__) || defined(__OpenBSD__) || defined(__FreeBSD__)
|
||||
switch (origin) {
|
||||
case STREAM_SEEK_BEGIN:
|
||||
fseeko(_file, offset, SEEK_SET);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
// Despite the name, this file contains support for more OSs besides Linux, provided the necessary ifdefs remain small.
|
||||
// Otherwise, they should be spun off into their own files.
|
||||
#if (defined(__linux__) || defined(__FREEBSD__) || defined(__OpenBSD__)) && !defined(__ANDROID__)
|
||||
#if (defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ANDROID__)
|
||||
|
||||
#ifdef __FREEBSD__
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,7 @@ void platform_get_exe_path(utf8 *outPath, size_t outSize)
|
||||
log_fatal("failed to read /proc/self/exe");
|
||||
}
|
||||
exePath[bytesRead - 1] = '\0';
|
||||
#elif defined(__FREEBSD__)
|
||||
#elif defined(__FreeBSD__)
|
||||
size_t exeLen = sizeof(exePath);
|
||||
const sint32 mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||
if (sysctl(mib, 4, exePath, &exeLen, NULL, 0) == -1) {
|
||||
|
||||
Reference in New Issue
Block a user