summaryrefslogtreecommitdiff
path: root/games/xdoom/patches/patch-ap
blob: b873f2a053499d08e9afa1504181ea546b4a103f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$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)