From 381016e1e0d9097d93db747882695109eba0cb4b Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Thu, 3 Apr 2008 20:09:36 +0000 Subject: [PATCH] While tracking a mimeset bug when building under Haiku, I found these. Not sure if these changes are correct byt they seem to make sense. Ingo? - Haiku uses the same code that BeOS/Dano/Zeta uses for mime related stuff during the build process. Added checking for HAIKU_HOST_PLATFORM_HAIKU where relevant. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24782 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/libbe/storage/Mime.cpp | 3 +-- src/build/libbe/storage/mime/MimeUpdateThread.cpp | 2 +- .../libbe/storage/mime/UpdateMimeInfoThread.cpp | 15 +++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/build/libbe/storage/Mime.cpp b/src/build/libbe/storage/Mime.cpp index dbc09b40a3..9a98ecf13d 100644 --- a/src/build/libbe/storage/Mime.cpp +++ b/src/build/libbe/storage/Mime.cpp @@ -15,7 +15,7 @@ #include #include #include -#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) +#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) && !defined(HAIKU_HOST_PLATFORM_HAIKU) # include #endif #include @@ -84,4 +84,3 @@ create_app_meta_mime(const char *path, int recursive, int synchronous, // We don't have a MIME DB... return B_OK; } - diff --git a/src/build/libbe/storage/mime/MimeUpdateThread.cpp b/src/build/libbe/storage/mime/MimeUpdateThread.cpp index 6753248410..155788c793 100644 --- a/src/build/libbe/storage/mime/MimeUpdateThread.cpp +++ b/src/build/libbe/storage/mime/MimeUpdateThread.cpp @@ -31,7 +31,7 @@ namespace BPrivate { namespace Storage { -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) // device_is_root_device bool device_is_root_device(dev_t device) diff --git a/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp b/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp index 71fa82c9f8..5ac22cc2e7 100644 --- a/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp +++ b/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp @@ -24,7 +24,7 @@ #include #include -#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) +#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) && !defined(HAIKU_HOST_PLATFORM_HAIKU) # include #else # define B_VECTOR_ICON_TYPE 'VICN' @@ -56,7 +56,7 @@ update_icon(BAppFileInfo &appFileInfoRead, BAppFileInfo &appFileInfoWrite, err = appFileInfoWrite.SetIconForType(type, &icon, iconSize); else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND) { err = appFileInfoWrite.SetIconForType(type, NULL, iconSize); -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) // gives an error if the attribute didn't exist yet... err = B_OK; #endif @@ -110,7 +110,7 @@ update_vector_icon(BFile& file, const char *type) } -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) // BMimeType::GuessMimeType() doesn't seem to work under BeOS status_t guess_mime_type(const void *_buffer, int32 length, BMimeType *type) @@ -220,7 +220,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) BMimeType type; if (!err && (updateType || updateAppInfo)) { err = BMimeType::GuessMimeType(entry, &type); -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) if (err) err = guess_mime_type(entry, &type); #endif @@ -261,7 +261,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) { // BeOS returns B_BAD_VALUE on shared libraries err = appFileInfoWrite.SetSignature(NULL); -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) err = B_OK; #endif } @@ -288,7 +288,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) err = appFileInfoWrite.SetSupportedTypes(&supportedTypes); hasSupportedTypes = true; } else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) { -#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) +#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE) || defined(HAIKU_HOST_PLATFORM_HAIKU) file.RemoveAttr(kSupportedTypesAttr); err = B_OK; #else @@ -333,7 +333,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) if (err == B_OK) err = appFileInfoWrite.SetVersionInfo(&versionInfo, kind); else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) { -#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) +#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE) && !defined(HAIKU_HOST_PLATFORM_HAIKU) // BeOS crashes when calling SetVersionInfo() with a NULL pointer err = appFileInfoWrite.SetVersionInfo(NULL, kind); #else @@ -376,4 +376,3 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) } // namespace Mime } // namespace Storage } // namespace BPrivate -