summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-18 09:51:02 +0000
committerpixel <pixel>2003-03-18 09:51:02 +0000
commit4331fdd18a60deea4951c54f2575abed0864ca83 (patch)
tree893f27ffe1cdd153a6e014e9a747442a81198779
parent283f5ca21aad7aa239d053268679b9e57012f13e (diff)
Fixing sparc port a bit
-rw-r--r--include/generic.h2
-rw-r--r--lib/Handle.cc14
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 <byteswap.h>
+#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