We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86f4c91 commit 78832feCopy full SHA for 78832fe
1 file changed
lib/path.cpp
@@ -52,6 +52,9 @@
52
#if defined(__APPLE__)
53
#include <mach-o/dyld.h>
54
#endif
55
+#if defined(__HAIKU__)
56
+#include <image.h>
57
+#endif
58
59
60
/** Is the filesystem case insensitive? */
@@ -158,6 +161,17 @@ std::string Path::getCurrentExecutablePath(const char* fallback)
158
161
#elif defined(__APPLE__)
159
162
uint32_t size = sizeof(buf);
160
163
success = (_NSGetExecutablePath(buf, &size) == 0);
164
+#elif defined(__HAIKU__)
165
+ int32 cookie = 0;
166
+ image_info info;
167
+ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK)
168
+ {
169
+ if (info.type == B_APP_IMAGE)
170
171
+ break;
172
+ }
173
174
+ return std::string(info.name);
175
#else
176
const char* procPath =
177
#ifdef __SVR4 // Solaris
0 commit comments