Autodetection of endianness.

svn-id: r3412
This commit is contained in:
Ludvig Strigeus 2001-10-09 17:38:20 +00:00
parent c30932afbe
commit 669dd77ee2
5 changed files with 37 additions and 8 deletions

View File

@ -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)

View File

@ -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
*
*
*/

View File

@ -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

10
sdl.cpp
View File

@ -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"

View File

@ -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
#endif