From 4331fdd18a60deea4951c54f2575abed0864ca83 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 18 Mar 2003 09:51:02 +0000 Subject: Fixing sparc port a bit --- include/generic.h | 2 +- lib/Handle.cc | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/generic.h b/include/generic.h index e11f518..9097ba0 100644 --- a/include/generic.h +++ b/include/generic.h @@ -13,7 +13,7 @@ #define bcopy(x,y,z) memcpy((y),(x),(z)) #endif -#ifndef SDL_VERSIONNUM +#if ! defined SDL_VERSIONNUM && ! defined Uint32 typedef unsigned long int Uint32; #endif diff --git a/lib/Handle.cc b/lib/Handle.cc index 68f4a7a..255eacd 100644 --- a/lib/Handle.cc +++ b/lib/Handle.cc @@ -7,8 +7,20 @@ #include "config.h" #endif -#if defined HAVE_BYTESWAP_H && defined WORDS_BIGENDIAN +#include "generic.h" + +#if defined WORDS_BIGENDIAN +#if defined HAVE_BYTESWAP_H #include +#else +inline Uint16 bswap_16(Uint16 w) { + return (w >> 8) | (w << 8); +} + +inline Uint32 bswap_32(Uint32 w) { + return (w >> 24) | ((w >> 8) & 0x0000ff00) | ((w << 8) & 0x00ff0000) | (w << 24); +} +#endif #endif #ifdef HAVE_UNISTD_H -- cgit v1.2.3