summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-02-03 21:51:42 +0000
committerDarkvater <Darkvater@openttd.org>2006-02-03 21:51:42 +0000
commite57ea5e57dea355ef86ff62089d505beae641c38 (patch)
treee7d2444a0b7e457cba604a7704ce886eb0a61612 /stdafx.h
parent144c1f39a484e5030f568cda41011791a3b5b104 (diff)
downloadopenttd-e57ea5e57dea355ef86ff62089d505beae641c38.tar.xz
(svn r3529) - Fix: [ 1415782 ] crash in string code with openbsd/zaurus; alignment issues (thanks Tron for the help)
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/stdafx.h b/stdafx.h
index 0589002a6..16933ab73 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -82,8 +82,6 @@
# define CDECL
# define NOT_REACHED() assert(0)
# define GCC_PACK
-# undef TTD_ALIGNMENT_4
-# undef TTD_ALIGNMENT_2
# include <malloc.h>
#endif /* __WATCOMC__ */
@@ -133,8 +131,6 @@
# endif
# endif /* _MSC_VER < 1300 */
-# undef TTD_ALIGNMENT_4
-# undef TTD_ALIGNMENT_2
# define GCC_PACK
// This is needed to zlib uses the stdcall calling convention on visual studio, also used with libpng (VS6 warning)
@@ -193,10 +189,13 @@ typedef unsigned char byte;
typedef unsigned __int64 uint64;
#endif /* __BEOS__ */
+#if defined(ARM) || defined(__arm__)
+# define OTTD_ALIGNMENT
+#endif
+
// Setup alignment and conversion macros
#if defined(TTD_BIG_ENDIAN)
-# define TTD_ALIGNMENT_2
-# define TTD_ALIGNMENT_4
+# define OTTD_ALIGNMENT
static inline uint32 TO_LE32(uint32 x) { return BSWAP32(x); }
static inline uint16 TO_LE16(uint16 x) { return BSWAP16(x); }
static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); }