From 5c260f683e26529d7cf02c12c1fff70a7a7e5eb8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Jun 2011 19:32:54 +0300 Subject: Add some fixes for making manaplus on OpenBSD. Based on patches by Jona (jaj) --- src/utils/paths.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/utils/paths.cpp') 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 #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; -- cgit v1.2.3-60-g2f50