Bug 747816 - Add big-endian tags to OTS r77. r=jfkthame, a=npotb
☠☠ backed out by f3d8b1faf611 ☠ ☠
authorCameron Kaiser <spectre@armory.com>
Mon, 23 Apr 2012 18:05:32 -0400
changeset 95473 e13cfb0b7497e30fe83a207bfaf99f5e208805a3
parent 95472 efba113561c6add878f293df132d69ac229782c7
child 95474 4c1aa39b85a9707c23c48e5936913c0ba202abd8
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, npotb
bugs747816
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 747816 - Add big-endian tags to OTS r77. r=jfkthame, a=npotb
gfx/ots/src/ots.cc
--- a/gfx/ots/src/ots.cc
+++ b/gfx/ots/src/ots.cc
@@ -78,17 +78,22 @@ struct Arena {
   }
 
  private:
   std::vector<uint8_t*> hunks_;
 };
 
 // Use a macro instead of a function because gcc 4.4.3 creates static
 // initializers in that case. Note this macro assumes a little-endian system.
+#if defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
+// This is the big-endian equivalent.
+#define TAG(d, c, b, a) (a | (b << 8) | (c << 16) | (d << 24))
+#else
 #define TAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24))
+#endif
 
 const struct {
   uint32_t tag;
   bool (*parse)(ots::OpenTypeFile *otf, const uint8_t *data, size_t length);
   bool (*serialise)(ots::OTSStream *out, ots::OpenTypeFile *file);
   bool (*should_serialise)(ots::OpenTypeFile *file);
   void (*free)(ots::OpenTypeFile *file);
   bool required;