Skip to content

Commit

Permalink
Fix for Lua 5.2 API change (luaL_register is deprecated)
Browse files Browse the repository at this point in the history
  • Loading branch information
obache committed Jul 19, 2015
1 parent 5e4e6a7 commit b322cce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lmyoslib.c
Expand Up @@ -157,7 +157,11 @@ static const luaL_Reg syslib[] = {


LUALIB_API int luaopen_myos (lua_State *L) {
#if LUA_VERSION_NUM >= 502
luaL_newlib(L, syslib);
#else
luaL_register(L, LUA_OSLIBNAME, syslib);
#endif
return 1;
}

4 changes: 4 additions & 0 deletions lua/lua-plugin-init.c
Expand Up @@ -425,7 +425,11 @@ static const luaL_Reg imelib[] = {
};

LUALIB_API int luaopen_ime (lua_State *L) {
#if LUA_VERSION_NUM >= 502
luaL_newlib(L, imelib);
#else
luaL_register(L, LUA_IMELIBNAME, imelib);
#endif
return 1;
}

0 comments on commit b322cce

Please sign in to comment.