diff options
author | Darkvater <darkvater@openttd.org> | 2006-02-03 21:51:42 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-02-03 21:51:42 +0000 |
commit | c5a669b39f6a78ee3ed0b819dd9bc5985cbb2c18 (patch) | |
tree | e7d2444a0b7e457cba604a7704ce886eb0a61612 /stdafx.h | |
parent | 6dd2affaad238c40e36d29593c9e8217966355f2 (diff) | |
download | openttd-c5a669b39f6a78ee3ed0b819dd9bc5985cbb2c18.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.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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); } |