diff options
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/common.c | 2 | ||||
-rw-r--r-- | code/qcommon/q_shared.h | 48 |
2 files changed, 48 insertions, 2 deletions
diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 60825f2..3fad8ed 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "q_shared.h" #include "qcommon.h" #include <setjmp.h> -#if defined __linux__ || defined MACOS_X || defined __FreeBSD__ +#if defined __linux__ || defined MACOS_X || defined __FreeBSD__ || defined __sun #include <netinet/in.h> #else #include <winsock.h> diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 41e634a..08d4c23 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -105,7 +105,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // this is the define for determining if we have an asm version of a C function -#if (defined _M_IX86 || defined __i386__) && !defined __sun__ && !defined __LCC__ +#if (defined _M_IX86 || defined __i386__) && !defined __sun && !defined __LCC__ #define id386 1 #else #define id386 0 @@ -355,6 +355,52 @@ static float LittleFloat (const float l) { return FloatSwap(&l); } #endif +//======================= SUNOS DEFINES ================================= + +#ifdef __sun + +#include <sys/isa_defs.h> + +// bk001205 - from Makefile +#define stricmp strcasecmp + +#define MAC_STATIC +#define ID_INLINE inline + +#ifdef __i386__ +#define CPUSTRING "Solaris-i386" +#elif defined __sparc +#define CPUSTRING "Solaris-sparc" +#endif + +#define PATH_SEP '/' + +// bk001205 - try +#ifdef Q3_STATIC +#define GAME_HARD_LINKED +#define CGAME_HARD_LINKED +#define UI_HARD_LINKED +#define BOTLIB_HARD_LINKED +#endif + +#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 */ +#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); } +#endif + +#endif + //============================================================= typedef unsigned char byte; |