mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r3549) - Change the behaviour of OTTD_ALIGNMENT. Force aligned reading as default, undefine it if unwanted/unneeded for some reason. I undeffed windows and watcom for now as they were like this.
This commit is contained in:
parent
64f14ed992
commit
a9211aebf7
10
stdafx.h
10
stdafx.h
|
@ -7,6 +7,9 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.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
|
// 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
|
// strgen always runs from terminal and don't need a window for asserts
|
||||||
#if !defined(__APPLE__) || defined(STRGEN)
|
#if !defined(__APPLE__) || defined(STRGEN)
|
||||||
|
@ -82,6 +85,7 @@
|
||||||
# define CDECL
|
# define CDECL
|
||||||
# define NOT_REACHED() assert(0)
|
# define NOT_REACHED() assert(0)
|
||||||
# define GCC_PACK
|
# define GCC_PACK
|
||||||
|
# undef OTTD_ALIGNMENT
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
#endif /* __WATCOMC__ */
|
#endif /* __WATCOMC__ */
|
||||||
|
|
||||||
|
@ -131,6 +135,7 @@
|
||||||
# endif
|
# endif
|
||||||
# endif /* _MSC_VER < 1300 */
|
# endif /* _MSC_VER < 1300 */
|
||||||
|
|
||||||
|
# undef OTTD_ALIGNMENT
|
||||||
# define GCC_PACK
|
# define GCC_PACK
|
||||||
|
|
||||||
// This is needed to zlib uses the stdcall calling convention on visual studio, also used with libpng (VS6 warning)
|
// This is needed to zlib uses the stdcall calling convention on visual studio, also used with libpng (VS6 warning)
|
||||||
|
@ -189,13 +194,8 @@ typedef unsigned char byte;
|
||||||
typedef unsigned __int64 uint64;
|
typedef unsigned __int64 uint64;
|
||||||
#endif /* __BEOS__ */
|
#endif /* __BEOS__ */
|
||||||
|
|
||||||
#if defined(ARM) || defined(__arm__)
|
|
||||||
# define OTTD_ALIGNMENT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Setup alignment and conversion macros
|
// Setup alignment and conversion macros
|
||||||
#if defined(TTD_BIG_ENDIAN)
|
#if defined(TTD_BIG_ENDIAN)
|
||||||
# define OTTD_ALIGNMENT
|
|
||||||
static inline uint32 TO_LE32(uint32 x) { return BSWAP32(x); }
|
static inline uint32 TO_LE32(uint32 x) { return BSWAP32(x); }
|
||||||
static inline uint16 TO_LE16(uint16 x) { return BSWAP16(x); }
|
static inline uint16 TO_LE16(uint16 x) { return BSWAP16(x); }
|
||||||
static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); }
|
static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); }
|
||||||
|
|
Loading…
Reference in New Issue