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 1/4] 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 From a90fa63c5b52529d2f7ca09dcc722588d1e93935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 2 Jul 2026 13:14:32 +0200 Subject: [PATCH 2/4] path.cpp: format fix --- lib/path.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/path.cpp b/lib/path.cpp index 0195c8b029a..a61f4660b59 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -162,16 +162,16 @@ std::string Path::getCurrentExecutablePath(const char* fallback) 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); + 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 From 2ab49cf99875a137d2302564d65cf57131aced92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 3 Jul 2026 14:11:50 +0200 Subject: [PATCH 3/4] Update lib/path.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Oliver Stöneberg --- lib/path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/path.cpp b/lib/path.cpp index a61f4660b59..894cd59ce0d 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -52,7 +52,7 @@ #if defined(__APPLE__) #include #endif -#if defined(__HAIKU__) +#elif defined(__HAIKU__) #include #endif From 44a5f0182b73332ddf73fabd21395a240a7fb847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 3 Jul 2026 14:12:45 +0200 Subject: [PATCH 4/4] Update path.cpp --- lib/path.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/path.cpp b/lib/path.cpp index 894cd59ce0d..fc059cdea4e 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -51,7 +51,6 @@ #endif #if defined(__APPLE__) #include -#endif #elif defined(__HAIKU__) #include #endif