diff options
author | Max Horn | 2010-07-05 16:11:34 +0000 |
---|---|---|
committer | Max Horn | 2010-07-05 16:11:34 +0000 |
commit | 782e43591a6eb5995036bebf2dcc2c871e4aed95 (patch) | |
tree | 1582e0758e9d8364cfd29d8ab85c5a8f907825e4 /backends/platform/ds/arm9/source/portdefs.h | |
parent | 3d44870c8a64999e5464fc3b09c08f9378c4a2d3 (diff) | |
download | scummvm-rg350-782e43591a6eb5995036bebf2dcc2c871e4aed95.tar.gz scummvm-rg350-782e43591a6eb5995036bebf2dcc2c871e4aed95.tar.bz2 scummvm-rg350-782e43591a6eb5995036bebf2dcc2c871e4aed95.zip |
DS: Cleanup NDS portdefs.h a bit
* Don't #include "nds/ndstypes.h" everywhere
* Don't #define ITCM_DATA globally, it is only need in one place
* Fix STREAM_AUDIO_FROM_DISK definition (copy&paste error)
* Fix custom assert() implementation by using the do/while(0) trick
for macros. Previously, there could be subtle errors caused by
statements like
if (COND) assert(...) else ...
svn-id: r50690
Diffstat (limited to 'backends/platform/ds/arm9/source/portdefs.h')
-rw-r--r-- | backends/platform/ds/arm9/source/portdefs.h | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h index 3b3925abba..bdb42993d1 100644 --- a/backends/platform/ds/arm9/source/portdefs.h +++ b/backends/platform/ds/arm9/source/portdefs.h @@ -26,24 +26,8 @@ #ifndef _PORTDEFS_H_ #define _PORTDEFS_H_ - - -/* -typedef unsigned char u8; -typedef signed char s8; - -typedef unsigned short u16; -typedef signed short s16; - -typedef unsigned int u32; -typedef signed int s32; -*/ - -#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. +// Somebody removed these from scummsys.h, but they're still required, so I'm +// adding them here in the hope that they'll stay. #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -53,8 +37,6 @@ typedef signed int s32; #define double float -#define CT_NO_TRANSPARENCY - #ifndef DISABLE_TEXT_CONSOLE #define DISABLE_TEXT_CONSOLE #endif @@ -63,15 +45,12 @@ typedef signed int s32; #define DISABLE_COMMAND_LINE #endif -#ifndef DISABLE_COMMAND_LINE +#ifndef STREAM_AUDIO_FROM_DISK #define STREAM_AUDIO_FROM_DISK #endif -//#undef assert -//#define assert(expr) consolePrintf("Asserted!") #define NO_DEBUG_MSGS - // This is defined in dsmain.cpp #ifdef __cplusplus extern "C" { @@ -86,15 +65,17 @@ void consolePrintf(const char *format, ...); #undef assert #endif -#define assert(s) if (!(s)) consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__) +#define assert(s) \ + do { \ + if (!(s)) \ + consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__); \ + } while (0) //#include "ds-fs.h" //#define debug(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__) //#define debug(fmt, ...) debug(0, fmt, ##__VA_ARGS__) -#define ITCM_DATA __attribute__((section(".itcm"))) - // FIXME: Since I can't change the engine at the moment (post lockdown) this define can go here. // This define changes the mouse-relative motion which doesn't make sense on a touch screen to // a more conventional form of input where the menus can be clicked on. |