diff options
| author | ruki <[email protected]> | 2023-12-17 00:20:57 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-17 00:20:57 +0800 |
| commit | c1948fb4fe3d9d9821195b3bc0e1270539882f97 (patch) | |
| tree | 9556dd20cc5ae05f0a7cbd653854ad644d71c0a3 | |
| parent | c9ebbda2042b6b018fed59810b6af894486e7f80 (diff) | |
| parent | 5f0771aca22599935dcf3190190bd6fa88c41476 (diff) | |
Merge pull request #4512 from cmeerw/get-program-file-for-haiku
Implement xm_engine_get_program_file for Haiku OS
| -rw-r--r-- | core/src/xmake/engine.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 311ffe464..d79f59d6a 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -46,6 +46,9 @@ # include <sys/sysctl.h> # include <signal.h> #endif +#ifdef TB_CONFIG_OS_HAIKU +# include <image.h> +#endif /* ////////////////////////////////////////////////////////////////////////////////////// * macros @@ -676,6 +679,18 @@ static tb_size_t xm_engine_get_program_file(xm_engine_t* engine, tb_char_t* path path[size] = '\0'; ok = tb_true; } +#elif defined(TB_CONFIG_OS_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) + { + tb_strlcpy(path, info.name, maxn); + ok = tb_true; + break; + } + } #else static tb_char_t const* s_paths[] = { |
