mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Indent preprocessor directives
This commit is contained in:
committed by
Hielke Morsink
parent
b02dfdbc93
commit
d787872cbe
@@ -9,22 +9,22 @@
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__linux__) && !defined(__ANDROID__))
|
||||
|
||||
#include <limits.h>
|
||||
#include <pwd.h>
|
||||
#if defined(__FreeBSD__)
|
||||
#include <stddef.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
||||
#endif // __FreeBSD__
|
||||
#if defined(__linux__)
|
||||
# include <limits.h>
|
||||
# include <pwd.h>
|
||||
# if defined(__FreeBSD__)
|
||||
# include <stddef.h>
|
||||
# include <sys/sysctl.h>
|
||||
# include <sys/types.h>
|
||||
# endif // __FreeBSD__
|
||||
# if defined(__linux__)
|
||||
// for PATH_MAX
|
||||
#include <linux/limits.h>
|
||||
#endif // __linux__
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../core/Util.hpp"
|
||||
#include "Platform2.h"
|
||||
#include "platform.h"
|
||||
# include <linux/limits.h>
|
||||
# endif // __linux__
|
||||
# include "../OpenRCT2.h"
|
||||
# include "../core/Path.hpp"
|
||||
# include "../core/Util.hpp"
|
||||
# include "Platform2.h"
|
||||
# include "platform.h"
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
@@ -72,10 +72,10 @@ namespace Platform
|
||||
{
|
||||
static const char* SearchLocations[] = {
|
||||
"../share/openrct2",
|
||||
#ifdef ORCT2_RESOURCE_DIR
|
||||
# ifdef ORCT2_RESOURCE_DIR
|
||||
// defined in CMakeLists.txt
|
||||
ORCT2_RESOURCE_DIR,
|
||||
#endif // ORCT2_RESOURCE_DIR
|
||||
# endif // ORCT2_RESOURCE_DIR
|
||||
"/usr/local/share/openrct2",
|
||||
"/var/lib/openrct2",
|
||||
"/usr/share/openrct2",
|
||||
@@ -140,26 +140,26 @@ namespace Platform
|
||||
std::string GetCurrentExecutablePath()
|
||||
{
|
||||
char exePath[PATH_MAX] = { 0 };
|
||||
#ifdef __linux__
|
||||
# ifdef __linux__
|
||||
auto bytesRead = readlink("/proc/self/exe", exePath, sizeof(exePath));
|
||||
if (bytesRead == -1)
|
||||
{
|
||||
log_fatal("failed to read /proc/self/exe");
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
# elif defined(__FreeBSD__)
|
||||
const int32_t mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||
auto exeLen = sizeof(exePath);
|
||||
if (sysctl(mib, 4, exePath, &exeLen, nullptr, 0) == -1)
|
||||
{
|
||||
log_fatal("failed to get process path");
|
||||
}
|
||||
#elif defined(__OpenBSD__)
|
||||
# elif defined(__OpenBSD__)
|
||||
// There is no way to get the path name of a running executable.
|
||||
// If you are not using the port or package, you may have to change this line!
|
||||
strlcpy(exePath, "/usr/local/bin/", sizeof(exePath));
|
||||
#else
|
||||
#error "Platform does not support full path exe retrieval"
|
||||
#endif
|
||||
# else
|
||||
# error "Platform does not support full path exe retrieval"
|
||||
# endif
|
||||
return exePath;
|
||||
}
|
||||
} // namespace Platform
|
||||
|
||||
Reference in New Issue
Block a user