From 9c3e2e43bde0c03ec012b83cd501a93a9ec4025e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 31 May 2011 13:48:03 +0200 Subject: COMMON: Move some code from scummsys.h to relevant portdefs.h files --- backends/platform/ds/arm9/source/portdefs.h | 7 +++++-- backends/platform/n64/portdefs.h | 13 +++++++++++++ backends/platform/symbian/src/portdefs.h | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h index 580eb680eb..f512ce3ea2 100644 --- a/backends/platform/ds/arm9/source/portdefs.h +++ b/backends/platform/ds/arm9/source/portdefs.h @@ -26,8 +26,11 @@ // Include ndstypes.h for uint16 etc. typedefs #include "nds/ndstypes.h" -// Somebody removed these from scummsys.h, but they're still required, so I'm -// adding them here in the hope that they'll stay. +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + +// Include required headers #include #include #include diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h index e62551355d..35ef3c71db 100644 --- a/backends/platform/n64/portdefs.h +++ b/backends/platform/n64/portdefs.h @@ -35,5 +35,18 @@ #undef assert #define assert(x) ((x) ? 0 : (print_error("ASSERT TRIGGERED:\n\n("#x")\n%s\nline: %d", __FILE__, __LINE__))) +// Typedef basic data types in a way that is compatible with the N64 SDK. +typedef unsigned char byte; +typedef unsigned char uint8; +typedef signed char int8; +typedef unsigned short int uint16; +typedef signed short int int16; +typedef unsigned int uint32; +typedef signed int int32; + +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + #endif diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index ebcd273659..8ad2fa98f5 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #ifndef SYMBIAN_PORTDEFS_H #define SYMBIAN_PORTDEFS_H + #include #include #include @@ -37,6 +39,25 @@ #define M_PI 3.14159265358979323846 #endif /* M_PI */ + +// Enable Symbians own datatypes +// This is done for two reasons +// a) uint is already defined by Symbians libc component +// b) Symbian is using its "own" datatyping, and the Scummvm port +// should follow this to ensure the best compability possible. +typedef unsigned char byte; +typedef unsigned char uint8; +typedef signed char int8; +typedef unsigned short int uint16; +typedef signed short int int16; +typedef unsigned long int uint32; +typedef signed long int int32; + +// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to +// re-define those data types. +#define SCUMMVM_DONT_DEFINE_TYPES + + #define DISABLE_COMMAND_LINE #if defined(USE_TREMOR) && !defined(USE_VORBIS) -- cgit v1.2.3