aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2011-06-01 10:43:02 +0200
committerMax Horn2011-06-01 10:43:02 +0200
commita4d105c902ce1b24c4edd1f3eb43b995bc46c0dd (patch)
tree4fae3d60079ec6e9b0cb1545ff1735ea7d90622f /common
parentc86a6c466fabe31fbf36363aa8d0ac8ea6001b9f (diff)
downloadscummvm-rg350-a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd.tar.gz
scummvm-rg350-a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd.tar.bz2
scummvm-rg350-a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd.zip
COMMON: Move SDL endian check a bit down
Diffstat (limited to 'common')
-rw-r--r--common/scummsys.h27
1 files 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 <SDL_endian.h>
-
- #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 <SDL_endian.h>
+
+ #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.