Skip to content

Commit

Permalink
fixed standard libraries loaded when new lua processes are created (i…
Browse files Browse the repository at this point in the history
…n lua 5.2 luaopen_bit32 must be called and in lua 5.2 and 5.3 luaopen_coroutine must be called)
  • Loading branch information
askyrme committed Sep 24, 2014
1 parent ad70dd6 commit fcf61ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
*
****************************************************

[v1.0-3]

* Fixed standard library load in new Lua processes. In Lua 5.2 the bit32
standard library must also be loaded. In Lua 5.2 and 5.3 the coroutine
standard library must also be loaded.

[v1.0-2]

* Added macros for compatibility with Lua 5.2 and 5.3.
Expand Down
6 changes: 6 additions & 0 deletions src/luaproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,12 @@ static void luaproc_openlualibs( lua_State *L ) {
luaproc_reglualib( L, "string", luaopen_string );
luaproc_reglualib( L, "math", luaopen_math );
luaproc_reglualib( L, "debug", luaopen_debug );
#if LUA_VERSION_NUM == 502
luaproc_reglualib( L, "bit32", luaopen_bit32 );
#endif
#if LUA_VERSION_NUM >= 502
luaproc_reglualib( L, "coroutine", luaopen_coroutine );
#endif
}

LUALIB_API int luaopen_luaproc( lua_State *L ) {
Expand Down

0 comments on commit fcf61ce

Please sign in to comment.