b8094222a3
correctly determine the endian of the host machine.
31 lines
800 B
Text
31 lines
800 B
Text
$NetBSD: patch-ap,v 1.2 2002/07/29 11:09:51 blymn Exp $
|
|
|
|
--- linuxdoom-1.10/m_swap.h.orig Tue Dec 23 06:44:41 1997
|
|
+++ linuxdoom-1.10/m_swap.h
|
|
@@ -23,19 +23,23 @@
|
|
#ifndef __M_SWAP__
|
|
#define __M_SWAP__
|
|
|
|
+#include <sys/endian.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma interface
|
|
#endif
|
|
|
|
+#if BYTE_ORDER == BIG_ENDIAN
|
|
+#define __BIG_ENDIAN__ 1
|
|
+#endif
|
|
|
|
// Endianess handling.
|
|
// WAD files are stored little endian.
|
|
#ifdef __BIG_ENDIAN__
|
|
-short SwapSHORT(short);
|
|
-long SwapLONG(long);
|
|
+unsigned short SwapSHORT(unsigned short);
|
|
+unsigned int SwapLONG(unsigned int);
|
|
#define SHORT(x) ((short)SwapSHORT((unsigned short) (x)))
|
|
-#define LONG(x) ((long)SwapLONG((unsigned long) (x)))
|
|
+#define LONG(x) ((int)SwapLONG((unsigned int) (x)))
|
|
#else
|
|
#define SHORT(x) (x)
|
|
#define LONG(x) (x)
|