summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-02-05 11:10:31 +0000
committerDarkvater <darkvater@openttd.org>2006-02-05 11:10:31 +0000
commit02c4e63fac1dd9e017d5d308527054bcd66f6f06 (patch)
tree823448f13fe788baca01b3168162b0db6096300d /stdafx.h
parent867e1acf084c5b789d8db964fe27b3ce396f213f (diff)
downloadopenttd-02c4e63fac1dd9e017d5d308527054bcd66f6f06.tar.xz
(svn r3553) - Revert r3549 "Change the behaviour of OTTD_ALIGNMENT". Some tests showed that forcing aligned reads slowed down the code (drawing smallmap) by 14%. Change back to the old behaviour.
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/stdafx.h b/stdafx.h
index 0f15a7b81..873b880a6 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -7,9 +7,6 @@
#include <string.h>
#include <stdlib.h>
-/* Default to forced alignment-reading. Undef if wanted */
-#define OTTD_ALIGNMENT
-
// MacOS X will use an NSAlert to display failed assertaions since they're lost unless running from a terminal
// strgen always runs from terminal and don't need a window for asserts
#if !defined(__APPLE__) || defined(STRGEN)
@@ -85,7 +82,6 @@
# define CDECL
# define NOT_REACHED() assert(0)
# define GCC_PACK
-# undef OTTD_ALIGNMENT
# include <malloc.h>
#endif /* __WATCOMC__ */
@@ -141,7 +137,6 @@
# endif
# endif /* _MSC_VER < 1300 */
-# undef OTTD_ALIGNMENT
# define GCC_PACK
// This is needed to zlib uses the stdcall calling convention on visual studio, also used with libpng (VS6 warning)
@@ -200,8 +195,13 @@ typedef unsigned char byte;
typedef unsigned __int64 uint64;
#endif /* __BEOS__ */
+#if defined(ARM) || defined(__arm__) || defined(__alpha__)
+# define OTTD_ALIGNMENT
+#endif
+
// Setup alignment and conversion macros
#if defined(TTD_BIG_ENDIAN)
+# 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); }