COMMON: Move some code from scummsys.h to relevant portdefs.h files
This commit is contained in:
parent
bea6858953
commit
9c3e2e43bd
4 changed files with 51 additions and 68 deletions
|
@ -26,8 +26,11 @@
|
||||||
// Include ndstypes.h for uint16 etc. typedefs
|
// Include ndstypes.h for uint16 etc. typedefs
|
||||||
#include "nds/ndstypes.h"
|
#include "nds/ndstypes.h"
|
||||||
|
|
||||||
// Somebody removed these from scummsys.h, but they're still required, so I'm
|
// Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to
|
||||||
// adding them here in the hope that they'll stay.
|
// re-define those data types.
|
||||||
|
#define SCUMMVM_DONT_DEFINE_TYPES
|
||||||
|
|
||||||
|
// Include required headers
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -35,5 +35,18 @@
|
||||||
#undef assert
|
#undef assert
|
||||||
#define assert(x) ((x) ? 0 : (print_error("ASSERT TRIGGERED:\n\n("#x")\n%s\nline: %d", __FILE__, __LINE__)))
|
#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
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,10 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SYMBIAN_PORTDEFS_H
|
#ifndef SYMBIAN_PORTDEFS_H
|
||||||
#define SYMBIAN_PORTDEFS_H
|
#define SYMBIAN_PORTDEFS_H
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -37,6 +39,25 @@
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif /* M_PI */
|
#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
|
#define DISABLE_COMMAND_LINE
|
||||||
|
|
||||||
#if defined(USE_TREMOR) && !defined(USE_VORBIS)
|
#if defined(USE_TREMOR) && !defined(USE_VORBIS)
|
||||||
|
|
|
@ -320,62 +320,10 @@
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Typedef our system types
|
// Typedef our system types unless they have already been defined by config.h,
|
||||||
|
// or SCUMMVM_DONT_DEFINE_TYPES is set.
|
||||||
//
|
//
|
||||||
#if !defined(HAVE_CONFIG_H)
|
#if !defined(HAVE_CONFIG_H) && !defined(SCUMMVM_DONT_DEFINE_TYPES)
|
||||||
|
|
||||||
#if defined(__SYMBIAN32__)
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
|
|
||||||
#elif defined(__GP32__)
|
|
||||||
|
|
||||||
// Override typenames. uint is already defined by system header files.
|
|
||||||
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;
|
|
||||||
|
|
||||||
#elif defined(__N64__)
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
#elif defined(__DS__)
|
|
||||||
|
|
||||||
// Do nothing, the SDK defines all types we need in nds/ndstypes.h,
|
|
||||||
// which we include in our portsdef.h
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef unsigned char byte;
|
typedef unsigned char byte;
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
typedef signed char int8;
|
typedef signed char int8;
|
||||||
|
@ -384,10 +332,8 @@
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
typedef signed int int32;
|
typedef signed int int32;
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Define scumm_stricmp and scumm_strnicmp
|
// Define scumm_stricmp and scumm_strnicmp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue