$NetBSD: patch-ac,v 1.4 2015/11/09 05:26:40 dholland Exp $ Fix byte order detection. --- bytesex.h.orig 2001-03-13 13:46:18.000000000 +0000 +++ bytesex.h @@ -3,18 +3,18 @@ #ifndef S10SH_BYTESEX_H #define S10SH_BYTESEX_H -#if defined(__i386__) \ - || defined(__alpha__) \ - || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) +#include + +#if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) +#define BYTE_ORDER_LITTLE_ENDIAN +#elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) +#define BYTE_ORDER_BIG_ENDIAN +#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == _LITTLE_ENDIAN) #define BYTE_ORDER_LITTLE_ENDIAN -#elif defined(__mc68000__) \ - || defined (__sparc__) \ - || defined (__sparc) \ - || defined (__PPC__) \ - || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) +#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == _BIG_ENDIAN) #define BYTE_ORDER_BIG_ENDIAN #else -# error can not find the byte order for this architecture, fix bytesex.h +#error can not find the byte order for this architecture, fix bytesex.h #endif #endif /* S10SH_BYTESEX_H */