From 24b3361cea084b9038c0f67bf423cd429877fd85 Mon Sep 17 00:00:00 2001 From: tma Date: Tue, 1 Nov 2005 16:05:06 +0000 Subject: * More Solaris work git-svn-id: svn://svn.icculus.org/quake3/trunk@205 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/q_shared.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'code/qcommon/q_shared.h') diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 39b4973..ab7eb32 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -346,6 +346,7 @@ static float LittleFloat (const float l) { return FloatSwap(&l); } #ifdef __sun #include +#include // bk001205 - from Makefile #define stricmp strcasecmp @@ -360,20 +361,24 @@ static float LittleFloat (const float l) { return FloatSwap(&l); } #define PATH_SEP '/' -#if defined(_LITTLE_ENDIAN) -inline static short BigShort( short l) { return ShortSwap(l); } -#define LittleShort -inline static int BigLong(int l) { return LongSwap(l); } -#define LittleLong -inline static float BigFloat(const float l) { return FloatSwap(&l); } -#define LittleFloat -#else /* Must be _BIG_ENDIAN */ +#if defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) #define BigShort inline static short LittleShort(short l) { return ShortSwap(l); } #define BigLong inline static int LittleLong (int l) { return LongSwap(l); } #define BigFloat inline static float LittleFloat (const float l) { return FloatSwap(&l); } + +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +inline static short BigShort( short l) { return ShortSwap(l); } +#define LittleShort +inline static int BigLong(int l) { return LongSwap(l); } +#define LittleLong +inline static float BigFloat(const float l) { return FloatSwap(&l); } +#define LittleFloat + +#else +#error "Either _BIG_ENDIAN or _LITTLE_ENDIAN must be #defined, but not both." #endif #endif -- cgit v1.2.3