diff --git a/lib/path.cpp b/lib/path.cpp index c4758dfeae9..fc059cdea4e 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -51,6 +51,8 @@ #endif #if defined(__APPLE__) #include +#elif defined(__HAIKU__) +#include #endif @@ -158,6 +160,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