diff --git a/lib/path.cpp b/lib/path.cpp index c4758dfeae9..0195c8b029a 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -52,6 +52,9 @@ #if defined(__APPLE__) #include #endif +#if defined(__HAIKU__) +#include +#endif /** Is the filesystem case insensitive? */ @@ -158,6 +161,17 @@ std::string Path::getCurrentExecutablePath(const char* fallback) #elif defined(__APPLE__) uint32_t size = sizeof(buf); success = (_NSGetExecutablePath(buf, &size) == 0); +#elif defined(__HAIKU__) + int32 cookie = 0; + image_info info; + while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) + { + if (info.type == B_APP_IMAGE) + { + break; + } + } + return std::string(info.name); #else const char* procPath = #ifdef __SVR4 // Solaris