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/mumblemanager.cpp | 6 +++--- src/resources/imagewriter.cpp | 5 +++++ src/utils/paths.cpp | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp index d3eacc64b..456606406 100644 --- a/src/mumblemanager.cpp +++ b/src/mumblemanager.cpp @@ -39,7 +39,7 @@ MumbleManager::~MumbleManager() { #ifdef WIN32 UnmapViewOfFile(mLinkedMem); -#elif defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__ +#elif defined BSD4_4 #else munmap(mLinkedMem, sizeof(struct LinkedMem)); #endif @@ -73,7 +73,7 @@ void MumbleManager::setMapBase(uint16_t mapid) void MumbleManager::init() { -#if defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__ +#if defined BSD4_4 return; #endif @@ -100,7 +100,7 @@ void MumbleManager::init() logger->log1("MumbleManager::init can't map MumbleLink"); return; } -#elif defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__ +#elif defined BSD4_4 #else char memName[256]; snprintf(memName, 256, "/MumbleLink.%d", getuid()); diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index d068b9c02..5d0bd9d94 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -24,8 +24,13 @@ #include "log.h" +#if defined __OpenBSD__ +#include +#include +#else #include #include +#endif #include #include "debug.h" 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-70-g09d2