Bug 1319389 - Generically set SK_CPU_[BL]ENDIAN based on __BYTE_ORDER__ when available. r=lsalzman
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 22 Nov 2016 20:09:02 +0900
changeset 324553 2a1e74ffb4fefbba254d18e558ff164a780d8836
parent 324552 758c23c92f087cf1253f97f4cc30201eb349224a
child 324554 89d9fb5f381b6476267f2a79f889c63a4d9992ec
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerslsalzman
bugs1319389
milestone53.0a1
Bug 1319389 - Generically set SK_CPU_[BL]ENDIAN based on __BYTE_ORDER__ when available. r=lsalzman
gfx/skia/skia/include/core/SkPreConfig.h
--- a/gfx/skia/skia/include/core/SkPreConfig.h
+++ b/gfx/skia/skia/include/core/SkPreConfig.h
@@ -67,25 +67,29 @@
 
 #if !defined(SK_WARN_UNUSED_RESULT)
     #define SK_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #endif
 
 //////////////////////////////////////////////////////////////////////
 
 #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
-    #if defined(__sparc) || defined(__sparc__) || \
+    #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+        #define SK_CPU_BENDIAN
+    #elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+        #define SK_CPU_LENDIAN
+    #elif defined(__sparc) || defined(__sparc__) || \
       defined(_POWER) || defined(__powerpc__) || \
       defined(__ppc__) || defined(__hppa) || \
       defined(__PPC__) || defined(__PPC64__) || \
       defined(_MIPSEB) || defined(__ARMEB__) || \
       defined(__s390__) || \
       (defined(__sh__) && defined(__BIG_ENDIAN__)) || \
       (defined(__ia64) && defined(__BIG_ENDIAN__))
-         #define SK_CPU_BENDIAN
+        #define SK_CPU_BENDIAN
     #else
         #define SK_CPU_LENDIAN
     #endif
 #endif
 
 //////////////////////////////////////////////////////////////////////
 
 #if defined(__i386) || defined(_M_IX86) ||  defined(__x86_64__) || defined(_M_X64)