From a12f3755769dea04a41785657c37dc90b443caaf Mon Sep 17 00:00:00 2001 From: "thomasvl@chromium.org" Date: Wed, 25 Feb 2009 20:42:12 +0000 Subject: Get DataPack compiling on Mac and run its unittest. Review URL: http://codereview.chromium.org/27152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10373 0039d316-1c4b-4281-b951-d872f2087c98 --- base/data_pack.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'base/data_pack.cc') diff --git a/base/data_pack.cc b/base/data_pack.cc index 17db8c4..f41c6da 100644 --- a/base/data_pack.cc +++ b/base/data_pack.cc @@ -91,8 +91,14 @@ bool DataPack::Load(const FilePath& path) { bool DataPack::Get(uint32_t resource_id, StringPiece* data) { // It won't be hard to make this endian-agnostic, but it's not worth // bothering to do right now. +#if defined(__BYTE_ORDER) + // Linux check COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, datapack_assumes_little_endian); +#elif defined(__BIG_ENDIAN__) + // Mac check + #error DataPack assumes little endian +#endif DataPackEntry* target = reinterpret_cast( bsearch(&resource_id, mmap_->data() + kHeaderLength, resource_count_, -- cgit v1.1