Branch: ulab-original

5bfe503c 2019-03-03 12:36:13 Timothy Pearson
Fix endianness checks on ppc64
M common/arch.h

common/arch.h

diff --git a/common/arch.h b/common/arch.h
index a380511..38bc6f2 100644
--- a/common/arch.h
+++ b/common/arch.h
@@ -26,11 +26,19 @@
 
 #if !(defined(L_ENDIAN) || defined(B_ENDIAN))
 /* check endianess */
-#if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \
-    defined(__hppa__)
-#define B_ENDIAN
+#if defined(__powerpc64__)
+# if defined(__BIG_ENDIAN__)
+#  define B_ENDIAN
+# else
+#  define L_ENDIAN
+# endif
 #else
-#define L_ENDIAN
+# if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \
+     defined(__hppa__)
+#  define B_ENDIAN
+# else
+#  define L_ENDIAN
+# endif
 #endif
 /* check if we need to align data */
 #if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \