summaryrefslogtreecommitdiff
path: root/games/xdoom/patches/patch-az
blob: 21bc527984362f90940a5ad6f4b9f9b5e8e72587 (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
32
33
34
35
36
37
38
$NetBSD: patch-az,v 1.2 2007/07/31 10:12:00 joerg Exp $

--- sndserv/wadread.c.orig	1997-01-30 19:54:23.000000000 +0000
+++ sndserv/wadread.c
@@ -39,7 +39,6 @@ static const char rcsid[] = "$Id: wadrea
 
 
 
-#include <malloc.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <stdio.h>
@@ -94,12 +93,7 @@ void**		lumpcache;
 // Something new.
 // This version of w_wad.c does handle endianess.
 //
-#ifndef __BIG_ENDIAN__
-
-#define LONG(x) (x)
-#define SHORT(x) (x)
-
-#else
+#if defined(__BIG_ENDIAN__) || (BYTE_ORDER == BIG_ENDIAN)
 
 #define LONG(x) ((long)SwapLONG((unsigned long) (x)))
 #define SHORT(x) ((short)SwapSHORT((unsigned short) (x)))
@@ -119,6 +113,11 @@ unsigned short SwapSHORT(unsigned short 
 	(x>>8) | (x<<8);
 }
 
+#else
+
+#define LONG(x) (x)
+#define SHORT(x) (x)
+
 #endif