[Scummvm-cvs-logs] scummvm master -> a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd

fingolfin max at quendi.de
Wed Jun 1 11:18:29 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a4d105c902 COMMON: Move SDL endian check a bit down


Commit: a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd
    https://github.com/scummvm/scummvm/commit/a4d105c902ce1b24c4edd1f3eb43b995bc46c0dd
Author: Max Horn (max at quendi.de)
Date: 2011-06-01T01:43:02-07:00

Commit Message:
COMMON: Move SDL endian check a bit down

Changed paths:
    common/scummsys.h



diff --git a/common/scummsys.h b/common/scummsys.h
index 62e2445..b6912504 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.






More information about the Scummvm-git-logs mailing list