Bug 491205: provide correct endianness macro definitions for big-endian NSPR_4_7_BRANCH
authorwtc%google.com
Sat, 13 Jun 2009 13:13:57 +0000
branchNSPR_4_7_BRANCH
changeset 4128 d38605caf95a7daf02cfd96152b58fb6cacf74ee
parent 4127 2f25ca7506693de158b320ba468c424942797f13
child 4129 73041caade4f51f5f3fe68c8b5457f6d64584ab1
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. Tag: NSPR_4_7_BRANCH
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