From 45ec6bf344c087d4b21ec7709d82b82c45e388bd Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 14 Jun 2011 11:29:08 +0000 Subject: [PATCH] BResources::SetToImage(): Compile conditionally based on HAIKU_TARGET_PLATFORM_HAIKU, so the file can also be compiled for the host platform. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42178 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Resources.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/kits/storage/Resources.cpp b/src/kits/storage/Resources.cpp index e1f652afcb..1fbf62b71f 100644 --- a/src/kits/storage/Resources.cpp +++ b/src/kits/storage/Resources.cpp @@ -60,7 +60,7 @@ BResources::BResources() \param clobber if \c true, the file's resources are truncated to size 0 */ BResources::BResources(const BFile* file, bool clobber) - : + : fFile(), fContainer(NULL), fResourceFile(NULL), @@ -247,7 +247,7 @@ BResources::SetTo(const entry_ref* ref, bool clobber) // delegate the actual work return SetTo(&file, clobber); } - + // SetToImage /*! \brief Re-initialized the BResources object to represent the resources of the file from which the specified image has been loaded. @@ -262,6 +262,7 @@ BResources::SetTo(const entry_ref* ref, bool clobber) status_t BResources::SetToImage(image_id image, bool clobber) { +#ifdef HAIKU_TARGET_PLATFORM_HAIKU // get an image info image_info info; status_t error = get_image_info(image, &info); @@ -272,8 +273,11 @@ BResources::SetToImage(image_id image, bool clobber) // delegate the actual work return SetTo(info.name, clobber); +#else // HAIKU_TARGET_PLATFORM_HAIKU + return B_NOT_SUPPORTED; +#endif } - + /*! \brief Re-initialized the BResources object to represent the resources of the file from which the specified image has been loaded. The image belongs to the current team and is identified by a pointer into @@ -291,6 +295,7 @@ BResources::SetToImage(image_id image, bool clobber) status_t BResources::SetToImage(const void* codeOrDataPointer, bool clobber) { +#ifdef HAIKU_TARGET_PLATFORM_HAIKU if (!codeOrDataPointer) return B_BAD_VALUE; @@ -309,6 +314,9 @@ BResources::SetToImage(const void* codeOrDataPointer, bool clobber) } return B_ENTRY_NOT_FOUND; +#else // HAIKU_TARGET_PLATFORM_HAIKU + return B_NOT_SUPPORTED; +#endif } // Unset