Apply patch #3517435 from Miles Bader - prefer to use Lua_pushglobaltable

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12985 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-04-14 20:37:39 +00:00
commit ac688f9ccb
3 changed files with 13 additions and 5 deletions

View file

@ -30,11 +30,7 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
int i;
/* start with global table */
#ifdef LUA_RIDX_GLOBALS
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
#else
lua_pushvalue(L,LUA_GLOBALSINDEX);
#endif
lua_pushglobaltable (L);
/* SWIG's internal initalisation */
SWIG_InitializeModule((void*)L);
SWIG_PropagateClientData();