Blame SOURCES/libwebp-0.3.0-endian-check.patch

29f79b
--- libwebp-0.3.0/examples/tiffdec.c.orig	2013-03-29 22:55:16.000000000 +0000
29f79b
+++ libwebp-0.3.0/examples/tiffdec.c	2014-08-19 00:06:28.972859672 +0100
29f79b
@@ -95,7 +95,7 @@
29f79b
       pic->width = width;
29f79b
       pic->height = height;
29f79b
       // TIFF data is ABGR
29f79b
-#ifdef __BIG_ENDIAN__
29f79b
+#if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
29f79b
       TIFFSwabArrayOfLong(raster, width * height);
29f79b
 #endif
29f79b
       ok = keep_alpha
29f79b
--- libwebp-0.3.0/src/dec/vp8.c.orig	2013-03-29 22:55:16.000000000 +0000
29f79b
+++ libwebp-0.3.0/src/dec/vp8.c	2014-08-19 00:06:28.972859672 +0100
29f79b
@@ -540,7 +540,7 @@
29f79b
 
29f79b
 // Macro to pack four LSB of four bytes into four bits.
29f79b
 #if defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || \
29f79b
-    defined(__BIG_ENDIAN__)
29f79b
+    (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
29f79b
 #define PACK_CST 0x08040201U
29f79b
 #else
29f79b
 #define PACK_CST 0x01020408U
29f79b
--- libwebp-0.3.0/src/dsp/lossless.c.orig	2014-08-19 00:06:28.973859689 +0100
29f79b
+++ libwebp-0.3.0/src/dsp/lossless.c	2014-08-19 00:09:58.349573103 +0100
29f79b
@@ -1255,7 +1255,7 @@
29f79b
       uint32_t argb = *src++;
29f79b
 
29f79b
 #if !defined(WEBP_REFERENCE_IMPLEMENTATION)
29f79b
-#if !defined(__BIG_ENDIAN__) && (defined(__i386__) || defined(__x86_64__))
29f79b
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) && (defined(__i386__) || defined(__x86_64__))
29f79b
       __asm__ volatile("bswap %0" : "=r"(argb) : "0"(argb));
29f79b
       *(uint32_t*)dst = argb;
29f79b
 #elif !defined(__BIG_ENDIAN__) && defined(_MSC_VER)
29f79b
--- libwebp-0.3.0/src/utils/bit_reader.h.orig	2013-03-29 22:55:16.000000000 +0000
29f79b
+++ libwebp-0.3.0/src/utils/bit_reader.h	2014-08-19 00:06:28.973859689 +0100
29f79b
@@ -155,7 +155,7 @@
29f79b
     bit_t bits;
29f79b
     lbit_t in_bits = *(lbit_t*)br->buf_;
29f79b
     br->buf_ += (BITS) >> 3;
29f79b
-#if !defined(__BIG_ENDIAN__)
29f79b
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
29f79b
 #if (BITS > 32)
29f79b
 // gcc 4.3 has builtin functions for swap32/swap64
29f79b
 #if defined(__GNUC__) && \
29f79b
@@ -192,7 +192,7 @@
29f79b
 #else   // BITS == 8
29f79b
     bits = (bit_t)in_bits;
29f79b
 #endif
29f79b
-#else    // BIG_ENDIAN
29f79b
+#else    // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
29f79b
     bits = (bit_t)in_bits;
29f79b
 #endif
29f79b
 #ifndef USE_RIGHT_JUSTIFY
29f79b
--- libwebp-0.3.0/src/utils/bit_writer.c.orig	2013-03-29 22:55:16.000000000 +0000
29f79b
+++ libwebp-0.3.0/src/utils/bit_writer.c	2014-08-19 00:06:28.973859689 +0100
29f79b
@@ -236,7 +236,7 @@
29f79b
 
29f79b
 void VP8LWriteBits(VP8LBitWriter* const bw, int n_bits, uint32_t bits) {
29f79b
   if (n_bits < 1) return;
29f79b
-#if !defined(__BIG_ENDIAN__)
29f79b
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
29f79b
   // Technically, this branch of the code can write up to 25 bits at a time,
29f79b
   // but in prefix encoding, the maximum number of bits written is 18 at a time.
29f79b
   {
29f79b
@@ -246,7 +246,7 @@
29f79b
     *(uint32_t*)p = v;
29f79b
     bw->bit_pos_ += n_bits;
29f79b
   }
29f79b
-#else  // BIG_ENDIAN
29f79b
+#else  // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
29f79b
   {
29f79b
     uint8_t* p = &bw->buf_[bw->bit_pos_ >> 3];
29f79b
     const int bits_reserved_in_first_byte = bw->bit_pos_ & 7;