tools/qemu: fix FreeBSD compile issue
[openwrt.git] / package / busybox / patches / 920-macosx-endian.patch
1 --- a/include/platform.h
2 +++ b/include/platform.h
3 @@ -154,14 +154,14 @@
4 # include <sex.h>
5 # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
6 # define __BYTE_ORDER BYTE_ORDER
7 -#elif defined __FreeBSD__
8 +#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__) || defined(__APPLE__)
9 # include <sys/resource.h> /* rlimit */
10 # include <machine/endian.h>
11 # define bswap_64 __bswap64
12 # define bswap_32 __bswap32
13 # define bswap_16 __bswap16
14 # define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN)
15 -#elif !defined __APPLE__
16 +#else
17 # include <byteswap.h>
18 # include <endian.h>
19 #endif
20 @@ -172,9 +172,15 @@
21 #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
22 # define BB_BIG_ENDIAN 1
23 # define BB_LITTLE_ENDIAN 0
24 +#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN
25 +# define BB_BIG_ENDIAN 1
26 +# define BB_LITTLE_ENDIAN 0
27 #elif (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__386__)
28 # define BB_BIG_ENDIAN 0
29 # define BB_LITTLE_ENDIAN 1
30 +#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN
31 +# define BB_BIG_ENDIAN 0
32 +# define BB_LITTLE_ENDIAN 1
33 #else
34 # error "Can't determine endianness"
35 #endif
This page took 0.042301 seconds and 5 git commands to generate.