Bug 491205: provide correct endianness macro definitions for big-endian
authorwtc%google.com
Tue, 05 May 2009 18:33:17 +0000
changeset 4096 b7966c70467bd0eca8b4f09766a2d20f40c7955c
parent 4094 392647fecd8b87dbe7afe4bf813aab521dd38350 (current diff)
parent 4095 3c3daa720e72dad61c45def922f9163660603ead (diff)
child 4097 37e53a452fe0afd959f6c20a27a52af7380b47b5
push idunknown
push userunknown
push dateunknown
bugs491205
Bug 491205: provide correct endianness macro definitions for big-endian ARM/Linux systems. The patch is contributed by Mikael Pettersson <mikpe@it.uu.se>. r=wtc.
pr/include/md/_linux.cfg
--- a/pr/include/md/_linux.cfg
+++ b/pr/include/md/_linux.cfg
@@ -516,18 +516,25 @@
 #define PR_ALIGN_OF_POINTER 4
 #define PR_ALIGN_OF_WORD    4
 
 #define PR_BYTES_PER_WORD_LOG2   2
 #define PR_BYTES_PER_DWORD_LOG2  3
 
 #elif defined(__arm__)
 
+#ifdef __ARMEB__
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#elif defined(__ARMEL__)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
+#else
+#error "Unknown ARM endianness."
+#endif
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
 #define PR_BYTES_PER_LONG   4
 #define PR_BYTES_PER_FLOAT  4
 #define PR_BYTES_PER_DOUBLE 8