Workaround for gcc 2.95 compiler bug.

svn-id: r32986
This commit is contained in:
Johannes Schickel 2008-07-10 11:25:43 +00:00
parent 03cd937b13
commit 092d9f38c5
2 changed files with 12 additions and 6 deletions

View File

@ -34,6 +34,7 @@ namespace Kyra {
TIMInterpreter::TIMInterpreter(KyraEngine_v1 *vm, OSystem *system) : _vm(vm), _system(system), _currentTim(0) {
#define COMMAND(x) { &TIMInterpreter::x, #x }
#define COMMAND_UNIMPL() { 0, 0 }
#define cmd_return(n) cmd_return_##n
static const CommandEntry commandProcs[] = {
// 0x00
COMMAND(cmd_initFunc0),
@ -66,15 +67,16 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *vm, OSystem *system) : _vm(vm), _s
COMMAND_UNIMPL(),
COMMAND(cmd_resetAllRuntimes),
// 0x18
COMMAND(cmd_return<1>),
COMMAND(cmd_return(1)),
COMMAND(cmd_execOpcode),
COMMAND(cmd_initFuncNow),
COMMAND(cmd_stopFuncNow),
// 0x1C
COMMAND(cmd_return<1>),
COMMAND(cmd_return<1>),
COMMAND(cmd_return<-1>)
COMMAND(cmd_return(1)),
COMMAND(cmd_return(1)),
COMMAND(cmd_return(n1))
};
#undef cmd_return
_commands = commandProcs;
_commandsSize = ARRAYSIZE(commandProcs);

View File

@ -102,8 +102,12 @@ private:
int cmd_execOpcode(const uint16 *param);
int cmd_initFuncNow(const uint16 *param);
int cmd_stopFuncNow(const uint16 *param);
template<int T>
int cmd_return(const uint16 *) { return T; }
#define cmd_return(n, v) \
int cmd_return_##n(const uint16 *) { return v; }
cmd_return( 1, 1);
cmd_return(n1, -1);
#undef cmd_return
};
} // end of namespace Kyra