mime/database_support: Make buildable for host platform

This commit is contained in:
Ingo Weinhold
2013-05-08 04:29:18 +02:00
parent ed92790ce5
commit 57a7a6b916
@@ -10,7 +10,11 @@
#include <mime/database_support.h> #include <mime/database_support.h>
#if defined(__HAIKU__) && !defined(HAIKU_HOST_PLATFORM_HAIKU)
# include <pthread.h> # include <pthread.h>
#endif
#include <new>
#include <Bitmap.h> #include <Bitmap.h>
#include <FindDirectory.h> #include <FindDirectory.h>
@@ -79,6 +83,10 @@ const char *kMetaMimeType = "application/x-vnd.Be-meta-mime";
// Error codes // Error codes
const status_t kMimeGuessFailureError = B_ERRORS_END+1; const status_t kMimeGuessFailureError = B_ERRORS_END+1;
#if defined(__HAIKU__) && !defined(HAIKU_HOST_PLATFORM_HAIKU)
static const directory_which kBaseDirectoryConstants[] = { static const directory_which kBaseDirectoryConstants[] = {
B_USER_SETTINGS_DIRECTORY, B_USER_SETTINGS_DIRECTORY,
B_USER_NONPACKAGED_DATA_DIRECTORY, B_USER_NONPACKAGED_DATA_DIRECTORY,
@@ -122,6 +130,23 @@ default_database_location()
} }
#else // building for the host platform
DatabaseLocation*
default_database_location()
{
// Should never actually be used, but make it valid, anyway.
static DatabaseLocation location;
if (location.Directories().IsEmpty())
location.AddDirectory("/tmp");
return &location;
}
#endif
/*! \brief Returns properly formatted raw bitmap data, ready to be shipped off /*! \brief Returns properly formatted raw bitmap data, ready to be shipped off
to the hacked up 4-parameter version of Database::SetIcon() to the hacked up 4-parameter version of Database::SetIcon()