summaryrefslogtreecommitdiff
path: root/src/fs/paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/paths.cpp')
-rw-r--r--src/fs/paths.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp
index 942f69471..492f5a449 100644
--- a/src/fs/paths.cpp
+++ b/src/fs/paths.cpp
@@ -1,8 +1,9 @@
/*
- * The ManaPlus Client
- * Copyright (C) 2011-2019 The ManaPlus Developers
+ * The ManaVerse Client
+ * Copyright (C) 2011-2020 The ManaPlus Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,22 +42,22 @@
#define realpath(N, R) strcpy(R, N)
#endif // __native_client__
-#ifdef WIN32
+#ifdef _WIN32
#include "fs/specialfolder.h"
#define realpath(N, R) _fullpath((R), (N), _MAX_PATH)
-#endif
+#endif // _WIN32
#if defined __OpenBSD__
#include <limits>
#else
#include <climits>
-#endif // WIN32
+#endif // __OpenBSD__
-#ifndef WIN32
+#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
-#endif // WIN32
+#endif // _WIN32
PRAGMA48(GCC diagnostic push)
PRAGMA48(GCC diagnostic ignored "-Wshadow")
@@ -147,7 +148,7 @@ void prepareFsPath(std::string &path)
std::string &fixDirSeparators(std::string &str)
{
-#ifdef WIN32
+#ifdef _WIN32
return replaceAll(str, "/", "\\");
#else
return str;
@@ -168,7 +169,7 @@ std::string removeLast(const std::string &str)
return str;
}
-#ifdef WIN32
+#ifdef _WIN32
std::string getSelfName()
{
return "manaplus.exe";
@@ -194,18 +195,18 @@ std::string getSelfName()
return "";
}
-#else // WIN32
+#else // _WIN32
std::string getSelfName()
{
return "";
}
-#endif // WIN32
+#endif // _WIN32
std::string getPicturesDir()
{
-#ifdef WIN32
+#ifdef _WIN32
std::string dir = getSpecialFolderLocation(CSIDL_MYPICTURES);
if (dir.empty())
dir = getSpecialFolderLocation(CSIDL_DESKTOP);
@@ -243,7 +244,7 @@ std::string getPicturesDir()
}
}
}
-#endif // WIN32
+#endif // _WIN32
return pathJoin(VirtFs::getUserDir(), "Desktop");
}
@@ -256,11 +257,11 @@ std::string getHomePath()
dir += dirSeparator;
return dir;
#else // defined(UNITTESTS) && defined(UNITESTSDIR)
-#ifdef WIN32
+#ifdef _WIN32
return getSpecialFolderLocation(CSIDL_LOCAL_APPDATA);
#elif defined(__SWITCH__)
return VirtFs::getBaseDir();
-#else
+#else // _WIN32
const char *path = getenv("HOME");
if (path == nullptr)
{
@@ -278,7 +279,7 @@ std::string getHomePath()
if (findLast(dir, std::string(dirSeparator)) == false)
dir += dirSeparator;
return dir;
-#endif // WIN32
+#endif // _WIN32
#endif // defined(UNITTESTS) && defined(UNITESTSDIR)
}