$NetBSD: patch-aa,v 1.2 2004/01/23 11:43:33 agc Exp $ --- misc/magic.h.orig Fri Sep 21 11:15:45 2001 +++ misc/magic.h Wed Mar 13 12:37:46 2002 @@ -99,7 +99,7 @@ : FALSE) #else #define ASSERT(p, where) (FALSE) -#endif PARANOID +#endif /* PARANOID */ /* ------------------------ Malloc/free ------------------------------- */ @@ -146,71 +146,13 @@ * */ -#ifdef i386 -#define IS_LITTLE_ENDIAN /* Intel x86 processors. */ -#endif - -#ifdef linux -#define IS_LITTLE_ENDIAN /* Intel x86 processors running Linux >=.99p7. */ -#endif - -#ifdef vax -#define IS_LITTLE_ENDIAN /* The good 'ol VAX. */ -#endif - -#ifdef MIPSEL -#define IS_LITTLE_ENDIAN /* MIPS processors in little-endian mode. */ -#endif - -#ifdef wrltitan -#define IS_LITTLE_ENDIAN /* A DEC-WRL titan research machine (only 20 exist). */ - /* NOT intended for the Ardent titan machine. */ -#endif - -#ifdef MIPSEB -#define IS_BIG_ENDIAN /* MIPS processors in big-endian mode. */ -#endif - -#ifdef mc68000 -#define IS_BIG_ENDIAN /* All 68xxx machines, such as Sun2's and Sun3's. */ -#endif - -#ifdef macII -#define IS_BIG_ENDIAN /* Apple MacII (also a 68000, but being safe here.) */ -#endif - -#ifdef sparc -#define IS_BIG_ENDIAN /* All SPARC-based machines. */ -#endif - -#ifdef ibm032 -#define IS_BIG_ENDIAN /* IBM PC-RT and related machines. */ -#endif - -#ifdef hp9000s300 -#define IS_BIG_ENDIAN /* HP 9000 machine. */ -#endif - -#ifdef hp9000s800 -#define IS_BIG_ENDIAN /* HP 9000 machine. */ -#endif - -#ifdef hp9000s820 -#define IS_BIG_ENDIAN /* HP 9000 machine. */ -#endif - -#ifdef ALPHA -#define IS_LITTLE_ENDIAN /* Digital Alpha AXP */ +#include +#if BYTE_ORDER==BIG_ENDIAN +#define IS_BIG_ENDIAN +#else +#define IS_LITTLE_ENDIAN #endif -/* Well, how'd we do? */ - -#if !defined(IS_BIG_ENDIAN) && !defined(IS_LITTLE_ENDIAN) - You_need_to_define_IS_LITTLE_ENDIAN_or_IS_BIG_ENDIAN_for_your_machine. -#endif -#if defined(IS_BIG_ENDIAN) && defined(IS_LITTLE_ENDIAN) - You_should_not_define_both_IS_LITTLE_ENDIAN_and_IS_BIG_ENDIAN. -#endif /* ------- Configuration: Handle Missing Routines/Definitions ------- */