diff options
author | Max Horn | 2011-05-23 18:59:37 +0200 |
---|---|---|
committer | Max Horn | 2011-05-23 19:12:25 +0200 |
commit | e6c78b4f469729726561af44aa1df8259f0fdf27 (patch) | |
tree | b8444895c21f551c1373e1ea1aefb7b075a10018 /engines/sword25/util/lua/ldo.cpp | |
parent | 8e3aafd30d14bcd586cc06a525e2dc2a8298c7b2 (diff) | |
download | scummvm-rg350-e6c78b4f469729726561af44aa1df8259f0fdf27.tar.gz scummvm-rg350-e6c78b4f469729726561af44aa1df8259f0fdf27.tar.bz2 scummvm-rg350-e6c78b4f469729726561af44aa1df8259f0fdf27.zip |
SWORD25: Include scummsys.h from lua.h, partially deal with the consequences
This should help mark the spots that are still non-portable, just follow
the FIXMEs.
Diffstat (limited to 'engines/sword25/util/lua/ldo.cpp')
-rw-r--r-- | engines/sword25/util/lua/ldo.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sword25/util/lua/ldo.cpp b/engines/sword25/util/lua/ldo.cpp index 07508fbb14..b03992385a 100644 --- a/engines/sword25/util/lua/ldo.cpp +++ b/engines/sword25/util/lua/ldo.cpp @@ -5,6 +5,14 @@ */ +// FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. +// Neither of these is supported in ScummVM. So we need to come up +// with a replacement. The most simple, direct and crude approach: +// Replace "throw" with an "error()" call. Of course we only +// would want to do that if this actually never happens... +#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp +#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp + #include <setjmp.h> #include <stdlib.h> #include <string.h> @@ -94,6 +102,11 @@ static void resetstack (lua_State *L, int status) { void luaD_throw (lua_State *L, int errcode) { if (L->errorJmp) { L->errorJmp->status = errcode; + // FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. + // Neither of these is supported in ScummVM. So we need to come up + // with a replacement. The most simple, direct and crude approach: + // Replace "throw" with an "error()" call. Of course we only + // would want to do that if this actually never happens... LUAI_THROW(L, L->errorJmp); } else { @@ -113,6 +126,11 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { lj.status = 0; lj.previous = L->errorJmp; /* chain new error handler */ L->errorJmp = &lj; + // FIXME: LUAI_THROW and LUAI_TRY use either throw/catch or setjmp/longjmp. + // Neither of these is supported in ScummVM. So we need to come up + // with a replacement. The most simple, direct and crude approach: + // Replace "throw" with an "error()" call. Of course we only + // would want to do that if this actually never happens... LUAI_TRY(L, &lj, (*f)(L, ud); ); |