From 78832fef2607e851c92f2ff93ac7dc4e3f8415cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 28 Jun 2026 18:09:20 +0200 Subject: [PATCH] implement Path::getCurrentExecutablePath for Haiku --- lib/path.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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