1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-14 03:10:47 +00:00
freebsd-ports/cad/magic/files/patch-misc::magic.h
Oliver Lehmann edf4887b7b magic.h wasn't able to determine LITTLE_ENDIAN xor BIG_ENDIAN for amd64.
include endian.h now and retrive that information directly from BYTE_ORDER

Noted By:	bento via kris
2004-01-31 12:17:14 +00:00

34 lines
713 B
C

--- misc/magic.h.orig Fri Sep 21 17:15:45 2001
+++ misc/magic.h Sat Jan 31 13:07:11 2004
@@ -18,6 +18,8 @@
* rcsid="$Header"
*/
+#include <machine/endian.h>
+
#define _MAGIC
/* Note: System files, such as "stdio.h" and "sys/types.h", should be
@@ -146,6 +148,12 @@
*
*/
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define IS_LITTLE_ENDIAN
+#elif BYTE_ORDER == BIG_ENDIAN
+#define IS_BIG_ENDIAN
+#endif
+
#ifdef i386
#define IS_LITTLE_ENDIAN /* Intel x86 processors. */
#endif
@@ -224,7 +232,7 @@
#if defined(sun) && !defined(sparc)
# define NEED_MONCNTL
#endif
-#ifdef ALPHA
+#if defined(ALPHA) || (defined(__alpha__) && defined(__FreeBSD__))
# define NEED_MONCNTL
#endif