From bfd0179042b0b02fb88748d54e56e7e208bb117f Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Wed, 2 Apr 2014 20:46:06 +0200 Subject: Revert "Update lua plugin to 5.2.3" FILE typedef to *void needs more work to not break sim and application builds. I checked only a few random native builds unfortunately. Sorry for inconvenience. --- apps/plugins/lua/rocklua.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apps/plugins/lua/rocklua.c') diff --git a/apps/plugins/lua/rocklua.c b/apps/plugins/lua/rocklua.c index 4f328dd..5539618 100644 --- a/apps/plugins/lua/rocklua.c +++ b/apps/plugins/lua/rocklua.c @@ -26,8 +26,7 @@ #include "rocklib.h" #include "luadir.h" -#undef LUA_BITLIBNAME -#define LUA_BITLIBNAME "bit" + static const luaL_Reg lualibs[] = { {"", luaopen_base}, @@ -35,7 +34,7 @@ static const luaL_Reg lualibs[] = { {LUA_STRLIBNAME, luaopen_string}, {LUA_OSLIBNAME, luaopen_os}, {LUA_ROCKLIBNAME, luaopen_rock}, - {LUA_BITLIBNAME, luaopen_bit32}, + {LUA_BITLIBNAME, luaopen_bit}, {LUA_IOLIBNAME, luaopen_io}, {LUA_LOADLIBNAME, luaopen_package}, {LUA_MATHLIBNAME, luaopen_math}, @@ -44,10 +43,11 @@ static const luaL_Reg lualibs[] = { }; static void rocklua_openlibs(lua_State *L) { - const luaL_Reg *lib; - for (lib = lualibs; lib->func; lib++) { - luaL_requiref(L, lib->name, lib->func, 1); - lua_pop(L, 1); /* remove lib */ + const luaL_Reg *lib = lualibs; + for (; lib->func; lib++) { + lua_pushcfunction(L, lib->func); + lua_pushstring(L, lib->name); + lua_call(L, 1, 0); } } -- cgit v1.1