Skip to content

Commit

Permalink
Merge pull request #4512 from cmeerw/get-program-file-for-haiku
Browse files Browse the repository at this point in the history
Implement xm_engine_get_program_file for Haiku OS
  • Loading branch information
waruqi committed Dec 16, 2023
2 parents c9ebbda + 5f0771a commit c1948fb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/src/xmake/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
# include <sys/sysctl.h>
# include <signal.h>
#endif
#ifdef TB_CONFIG_OS_HAIKU
# include <image.h>
#endif

/* //////////////////////////////////////////////////////////////////////////////////////
* macros
Expand Down Expand Up @@ -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[] =
{
Expand Down

0 comments on commit c1948fb

Please sign in to comment.