Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
#if defined(__HAIKU__)
#include <image.h>
#endif


/** Is the filesystem case insensitive? */
Expand Down Expand Up @@ -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
Expand Down