summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-30 19:32:54 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-30 19:57:08 +0300
commit5c260f683e26529d7cf02c12c1fff70a7a7e5eb8 (patch)
tree5b36a813ae964b7b9d5709c6bbce6e1b68d64699 /src/utils
parenta7c7cc655f94acc4476e681ac258ff6981702944 (diff)
downloadmanaplus-5c260f683e26529d7cf02c12c1fff70a7a7e5eb8.tar.gz
manaplus-5c260f683e26529d7cf02c12c1fff70a7a7e5eb8.tar.bz2
manaplus-5c260f683e26529d7cf02c12c1fff70a7a7e5eb8.tar.xz
manaplus-5c260f683e26529d7cf02c12c1fff70a7a7e5eb8.zip
Add some fixes for making manaplus on OpenBSD.
Based on patches by Jona (jaj)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/paths.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 8882808fa..b42caf9b5 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -28,6 +28,8 @@
#ifdef WIN32
#define realpath(N, R) _fullpath((R), (N), _MAX_PATH)
+#elif defined __OpenBSD__
+#include <limits.h>
#endif
#include "debug.h"
@@ -35,7 +37,12 @@
std::string getRealPath(const std::string &str)
{
std::string path;
+#if defined __OpenBSD__
+ char *realPath = (char*)calloc(PATH_MAX, sizeof(char));
+ realpath(str.c_str(), realPath);
+#else
char *realPath = realpath(str.c_str(), NULL);
+#endif
path = realPath;
free(realPath);
return path;