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 --- lib/Handle.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') 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