diff options
Diffstat (limited to 'iup/srclua5/iuplua_cd.c')
-rwxr-xr-x | iup/srclua5/iuplua_cd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/iup/srclua5/iuplua_cd.c b/iup/srclua5/iuplua_cd.c index c14932a..184ef84 100755 --- a/iup/srclua5/iuplua_cd.c +++ b/iup/srclua5/iuplua_cd.c @@ -39,8 +39,13 @@ static cdluaContext cdluaiupctx = int cdluaiup_open (lua_State *L) { cdluaLuaState* cdL = cdlua_getstate(L); + /* leave "cd" table at the top of the stack */ lua_pushstring(L, "cd"); - lua_gettable(L, LUA_GLOBALSINDEX); /* leave "cd" table at the top of the stack */ +#if LUA_VERSION_NUM > 501 + lua_pushglobaltable(L); +#else + lua_gettable(L, LUA_GLOBALSINDEX); +#endif cdlua_addcontext(L, cdL, &cdluaiupctx); return 1; } @@ -50,7 +55,3 @@ int luaopen_iupluacd(lua_State* L) return cdluaiup_open(L); } -int luaopen_iupluacd51(lua_State* L) -{ - return cdluaiup_open(L); -} |