aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-07-17 23:31:52 +0000
committerMax Horn2002-07-17 23:31:52 +0000
commit344690c522fc0f32cd3b9f0afba2b77650e03e86 (patch)
tree9c34030c5f8e5187de86adeec3989b2cbeec76c8
parent862e0b26bc5b1f1a564dd9f1064b2c7dde551436 (diff)
downloadscummvm-rg350-344690c522fc0f32cd3b9f0afba2b77650e03e86.tar.gz
scummvm-rg350-344690c522fc0f32cd3b9f0afba2b77650e03e86.tar.bz2
scummvm-rg350-344690c522fc0f32cd3b9f0afba2b77650e03e86.zip
patch for compiling on Alpha. We probably should switch all our 'long's to 'int's
svn-id: r4584
-rw-r--r--scummsys.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/scummsys.h b/scummsys.h
index 92d7dbc70f..199ad9b99f 100644
--- a/scummsys.h
+++ b/scummsys.h
@@ -115,12 +115,26 @@ typedef signed long int32;
typedef unsigned char byte;
typedef unsigned char uint8;
typedef unsigned short uint16;
-typedef unsigned long uint32;
typedef unsigned int uint;
typedef signed char int8;
typedef signed short int16;
+
+# if defined(__DECCXX) // Assume alpha architecture
+
+# define INVERSE_MKID
+# define SCUMM_NEED_ALIGNMENT
+
+typedef unsigned int uint32;
+typedef signed int int32;
+
+# else
+
+typedef unsigned long uint32;
typedef signed long int32;
+# endif
+
+
#if defined(__GNUC__)
#define START_PACK_STRUCTS
#define END_PACK_STRUCTS
@@ -229,8 +243,18 @@ typedef signed long int32;
//#error Little endian processors that need alignment is not implemented
//#endif
-#define MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
-#define MKID_BE(a) (a)
+
+#define PROTO_MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+#define PROTO_MKID_BE(a) (a & 0xffffffff)
+
+#if defined(INVERSE_MKID)
+# define MKID(a) PROTO_MKID_BE(a)
+# define MKID_BE(a) PROTO_MKID(a)
+#else
+# define MKID(a) PROTO_MKID(a)
+# define MKID_BE(a) PROTO_MKID_BE(a)
+#endif
+
#if defined(SCUMM_NEED_ALIGNMENT)
FORCEINLINE uint READ_LE_UINT16(void *ptr) {