Skip to content

Commit

Permalink
compatible with Lua5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
starwing committed Sep 11, 2015
1 parent f30a831 commit ac78379
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lgbk.c
Expand Up @@ -288,7 +288,12 @@ LUALIB_API int luaopen_gbk(lua_State *L) {
#undef ENTRY
{ NULL, NULL }
};
#if LUA_VERSION_NUM >= 502
luaL_newlib(L, libs);
#else
lua_newtable(L);
luaL_register(L, NULL, libs);
#endif
return 1;
}
/* cc: flags+='-s -mdll -O2 -DLUA_BUILD_AS_DLL'
Expand Down
5 changes: 5 additions & 0 deletions lpinyin.c
Expand Up @@ -545,7 +545,12 @@ LUALIB_API int luaopen_pinyin(lua_State *L) {
#undef ENTRY
{ NULL, NULL }
};
#if LUA_VERSION_NUM >= 502
luaL_newlib(L, libs);
#else
lua_newtable(L);
luaL_register(L, NULL, libs);
#endif
return 1;
}
/* cc: flags+='-shared -s -O3 -DLUA_BUILD_AS_DLL' libs+='-llua53'
Expand Down

0 comments on commit ac78379

Please sign in to comment.