aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--scumm.h8
-rw-r--r--scummsys.h21
-rw-r--r--sdl.cpp10
-rw-r--r--stdafx.h4
5 files changed, 37 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 933772a4bf..fb6c4ca2b4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
CC = gcc
CFLAGS = -g -O2 -Wno-multichar
-DEFINES = -DUNIX -DSCUMM_BIG_ENDIAN -DSCUMM_NEED_ALIGNMENT
+DEFINES = -DUNIX
LDFLAGS = `sdl-config --libs`
INCLUDES= `sdl-config --cflags`
CPPFLAGS= $(DEFINES) $(INCLUDES)
diff --git a/scumm.h b/scumm.h
index 78be39c15e..395989516b 100644
--- a/scumm.h
+++ b/scumm.h
@@ -17,8 +17,12 @@
*
* Change Log:
* $Log$
- * Revision 1.1 2001/10/09 14:30:12 strigeus
- * Initial revision
+ * Revision 1.2 2001/10/09 17:38:20 strigeus
+ * Autodetection of endianness.
+ *
+ * Revision 1.1.1.1 2001/10/09 14:30:12 strigeus
+ *
+ * initial revision
*
*
*/
diff --git a/scummsys.h b/scummsys.h
index ae91e1e3e5..7002994999 100644
--- a/scummsys.h
+++ b/scummsys.h
@@ -17,8 +17,12 @@
*
* Change Log:
* $Log$
- * Revision 1.1 2001/10/09 14:30:14 strigeus
- * Initial revision
+ * Revision 1.2 2001/10/09 17:38:20 strigeus
+ * Autodetection of endianness.
+ *
+ * Revision 1.1.1.1 2001/10/09 14:30:14 strigeus
+ *
+ * initial revision
*
*
*/
@@ -44,6 +48,19 @@ typedef signed long int32;
#elif defined(UNIX)
+/* need this for the SDL_BYTEORDER define */
+
+#include <SDL_byteorder.h>
+
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define SCUMM_LITTLE_ENDIAN
+#elif SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define SCUMM_BIG_ENDIAN
+#define SCUMM_NEED_ALIGNMENT
+#else
+#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set.
+#endif
+
#define FORCEINLINE inline
#define NORETURN
#define CDECL
diff --git a/sdl.cpp b/sdl.cpp
index 9d2d6db5ac..8c7184e4d9 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -17,12 +17,18 @@
*
* Change Log:
* $Log$
- * Revision 1.1 2001/10/09 14:30:13 strigeus
- * Initial revision
+ * Revision 1.2 2001/10/09 17:38:20 strigeus
+ * Autodetection of endianness.
+ *
+ * Revision 1.1.1.1 2001/10/09 14:30:13 strigeus
+ *
+ * initial revision
*
*
*/
+#define NEED_SDL_HEADERS
+
#include "stdafx.h"
#include "scumm.h"
diff --git a/stdafx.h b/stdafx.h
index 1416fa4210..f864d3296c 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -42,7 +42,9 @@
#else
+#if defined(NEED_SDL_HEADERS)
#include <SDL.h>
+#endif
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
@@ -55,4 +57,4 @@
-#endif \ No newline at end of file
+#endif