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:
Ingo Weinhold 2005-01-17 01:20:22 +00:00
parent 523144419b
commit 9171d496e2
2 changed files with 20 additions and 0 deletions

View File

@ -41,6 +41,8 @@ status_t get_app_ref(entry_ref *ref, bool traverse = true);
team_id current_team();
thread_id main_thread_for(team_id team);
bool is_running_on_haiku();
} // namespace BPrivate
// _get_object_token_

View File

@ -25,6 +25,7 @@
//------------------------------------------------------------------------------
#include <string.h>
#include <sys/utsname.h>
#include <AppMisc.h>
#include <Entry.h>
@ -128,5 +129,22 @@ main_thread_for(team_id team)
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