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:
parent
df4f9adf0a
commit
ac688f9ccb
3 changed files with 13 additions and 5 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 2.0.5 (in progress)
|
Version 2.0.5 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2012-04-14: wsfulton
|
||||||
|
[Lua] Apply patch #3517435 from Miles Bader - prefer to use Lua_pushglobaltable
|
||||||
|
|
||||||
2012-04-14: wsfulton
|
2012-04-14: wsfulton
|
||||||
[Ruby] Apply patch #3517769 from Robin Stocker to fix compile error on MacRuby using RSTRING_PTR.
|
[Ruby] Apply patch #3517769 from Robin Stocker to fix compile error on MacRuby using RSTRING_PTR.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,15 @@ extern "C" {
|
||||||
# define lua_rawlen lua_objlen
|
# define lua_rawlen lua_objlen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* lua_pushglobaltable is the recommended "future-proof" way to get
|
||||||
|
the global table for Lua 5.2 and later. Here we define
|
||||||
|
lua_pushglobaltable ourselves for Lua versions before 5.2. */
|
||||||
|
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
|
||||||
|
# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* global swig types
|
* global swig types
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
|
||||||
int i;
|
int i;
|
||||||
/* start with global table */
|
/* start with global table */
|
||||||
#ifdef LUA_RIDX_GLOBALS
|
lua_pushglobaltable (L);
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
|
|
||||||
#else
|
|
||||||
lua_pushvalue(L,LUA_GLOBALSINDEX);
|
|
||||||
#endif
|
|
||||||
/* SWIG's internal initalisation */
|
/* SWIG's internal initalisation */
|
||||||
SWIG_InitializeModule((void*)L);
|
SWIG_InitializeModule((void*)L);
|
||||||
SWIG_PropagateClientData();
|
SWIG_PropagateClientData();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue