Added function is_running_on_haiku(), which returns at runtime whether we're running under Haiku.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10783 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
523144419b
commit
9171d496e2
@ -41,6 +41,8 @@ status_t get_app_ref(entry_ref *ref, bool traverse = true);
|
|||||||
team_id current_team();
|
team_id current_team();
|
||||||
thread_id main_thread_for(team_id team);
|
thread_id main_thread_for(team_id team);
|
||||||
|
|
||||||
|
bool is_running_on_haiku();
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
// _get_object_token_
|
// _get_object_token_
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
#include <AppMisc.h>
|
#include <AppMisc.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
@ -128,5 +129,22 @@ main_thread_for(team_id team)
|
|||||||
return thread;
|
return thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// is_running_on_haiku
|
||||||
|
/*! Returns whether we're running under Haiku natively.
|
||||||
|
|
||||||
|
This is a runtime check for components compiled only once for both
|
||||||
|
BeOS and Haiku and nevertheless need to behave differently on the two
|
||||||
|
systems, like the registrar, which uses another MIME database directory
|
||||||
|
under BeOS.
|
||||||
|
|
||||||
|
\return \c true, if we're running under Haiku, \c false otherwise.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
is_running_on_haiku()
|
||||||
|
{
|
||||||
|
struct utsname info;
|
||||||
|
return (uname(&info) == 0 && strcmp(info.sysname, "Haiku") == 0);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user