From 57a7a6b9168931a2f209327bc40959a016ca8bb2 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 8 May 2013 04:29:18 +0200 Subject: [PATCH] mime/database_support: Make buildable for host platform --- src/kits/storage/mime/database_support.cpp | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/kits/storage/mime/database_support.cpp b/src/kits/storage/mime/database_support.cpp index 76f36ba5d0..371a184e50 100644 --- a/src/kits/storage/mime/database_support.cpp +++ b/src/kits/storage/mime/database_support.cpp @@ -10,7 +10,11 @@ #include -#include +#if defined(__HAIKU__) && !defined(HAIKU_HOST_PLATFORM_HAIKU) +# include +#endif + +#include #include #include @@ -79,6 +83,10 @@ const char *kMetaMimeType = "application/x-vnd.Be-meta-mime"; // Error codes const status_t kMimeGuessFailureError = B_ERRORS_END+1; + +#if defined(__HAIKU__) && !defined(HAIKU_HOST_PLATFORM_HAIKU) + + static const directory_which kBaseDirectoryConstants[] = { B_USER_SETTINGS_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 to the hacked up 4-parameter version of Database::SetIcon()