From: Alex-P. N. <apn...@gm...> - 2012-09-08 08:33:20
|
Greetings people, just forwarding this here, along with a patch by Dennis Schridde with compatibility fixes ( Lua 5.1 -> Lua 5.2). ( i added him on CC too since he is not on the list ). ---------- Forwarded message ---------- From: Dennis Schridde <dev...@gm...> Date: Sat, Sep 8, 2012 at 1:30 AM Subject: [PATCH] Edje r76321 Lua 5.2 compatibility To: apn...@gm... Hi! I ported Edje r76321 to compile and run with Lua 5.2. Please find the patch attached. Please CC me, as I am not on the list (drakevr just proxied this email for me). The changes have been tested with lua_script.edc and I could not notice a change in behaviour and only minor changes in the console output (minor differences in timestamps and coordinates). Necessary changes for Lua 5.2 compatibility were: * lua_objlen was renamed to lua_rawlen * luaL_register was removed, as Lua discourages modules setting globals now. I replaced it with one of two ways (depending on the context): - Where libname is NULL, I simply call luaL_setfuncs. There is no change in functionality. - Where libname was not NULL, I create a global table and call luaL_setfuncs on it. This gets the job done, but is not equivalent to luaL_register. If you want to be stricter (in case you load the same module multiple times, for example), luaL_requiref should be called with a luaopen_* function, which should call luaL_newlib. The result of luaL_requiref should then be set via lua_setglobal. Necessary changes for Lua 5.1 compatibility were: * table.getn(t) was replaced by the #t operator Best regards, Dennis -- Regards, Alex-P. Natsios (a.k.a Drakevr) |