From a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 1 Jun 2011 10:43:02 +0200 Subject: COMMON: Move SDL endian check a bit down --- common/scummsys.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/common/scummsys.h b/common/scummsys.h index 62e244585a..b691250419 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -143,19 +143,8 @@ // Determine the host endianess and whether memory alignment is required. // #if !defined(HAVE_CONFIG_H) - #if defined(SDL_BACKEND) - /* need this for the SDL_BYTEORDER define */ - #include - - #if SDL_BYTEORDER == SDL_LIL_ENDIAN - #define SCUMM_LITTLE_ENDIAN - #elif SDL_BYTEORDER == SDL_BIG_ENDIAN - #define SCUMM_BIG_ENDIAN - #else - #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set. - #endif - #elif defined(__DC__) || \ + #if defined(__DC__) || \ defined(__DS__) || \ defined(__GP32__) || \ defined(IPHONE) || \ @@ -175,6 +164,20 @@ #define SCUMM_BIG_ENDIAN #define SCUMM_NEED_ALIGNMENT + #elif defined(SDL_BACKEND) + // On SDL based ports, we try to use SDL_BYTEORDER to determine the + // endianess. We explicitly do this as the *last* thing we try, so that + // platform specific settings have precedence. + #include + + #if SDL_BYTEORDER == SDL_LIL_ENDIAN + #define SCUMM_LITTLE_ENDIAN + #elif SDL_BYTEORDER == SDL_BIG_ENDIAN + #define SCUMM_BIG_ENDIAN + #else + #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set. + #endif + #else #error No system type defined, host endianess unknown. -- cgit v1.2.3