summaryrefslogtreecommitdiff
path: root/debian/patches/ftbfs-big-endian.patch
blob: 5c03da41b33edbb6f989586b0458b29c23405f82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: Fix big-endian FTBFS (Closes: #733831)
Author: Dimitri John Ledkov <xnox@ubuntu.com>
Bug-Debian: http://bugs.debian.org/733831

--- wiggle-0.9.1.orig/config.h
+++ wiggle-0.9.1/config.h
@@ -1,13 +1,17 @@
 
 /* Includes and defines for ccan files */
 
-#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
- #include <endian.h>
+#if !defined(BYTE_ORDER) && !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
+ #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+  #include <machine/endian.h>
+ #else
+  #include <endian.h>
+ #endif
 #endif
-#ifdef LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
  #define HAVE_LITTLE_ENDIAN 1
  #define HAVE_BIG_ENDIAN 0
-#elif defined(BIG_ENDIAN)
+#elif BYTE_ORDER == BIG_ENDIAN
  #define HAVE_LITTLE_ENDIAN 0
  #define HAVE_BIG_ENDIAN 1
 #else