[Scummvm-devel] LUA on WinCE and PS2

Max Horn max at quendi.de
Tue May 17 11:25:46 CEST 2011


Am 17.05.2011 um 11:09 schrieb Paul Gilbert:
[...]
> As far as I'm aware, the game doesn't actually use that function - it's just part of the LUA library. So we've got two options - either provide a dummy prototype so it'll compile okay, or directly modify the LUA code to comment out the call. I would lean towards the former, so as to keep the LUA code as pristine as possible. Although changing it in the code means it would be fixed for all other systems as well.

Changing the backend to cover up portability issues in the engine is not an option that scales, and hence IMO is not an option at all.

If you guys want to use a pristine Lua, I recommend removing Lua from the core code, and linking against an externally compiled pristine Lua. Although I wonder *why* you want to keep it pristine... ? It's not as if you were going to upgrade it to Lua 5.2, would you? And if there are security fixes, it should be easy enough to backport them (although, strictly speaking, there are gazillions of easily exploitable spots in ScummVM, so you may want to address those first ;).


If you want to keep Lua directly inside ScummVM, you'll have to work around any portability issues it has. This has been explained on this very list before, even including lists of problematic symbols in the Lua code :).

One approach: Strip the (hopefully unused) non-portable code. Alternatively, if you prefer to stay "as close as possible" to plain Lua, you could try to use #define hackery inside the sword25 engine, to provide your own compatibility layer. E.g. you could add this to a special lua_compat.h and include that in a suitable place so that all lua files get it:

  #define tmpfile scummvm_tmpfile

  FILE *scumm_tmpfile(void)

But actually, FILE itself is also not allowed in ScummVM code (and hence also overridden by common/forbidden.h), so you'd also have to take care of that... All in all, I really wonder if it's worth the effort... 


Bye,
Max



More information about the Scummvm-devel mailing list