@@ -17,6 +17,7 @@ ptr_lua_gettop LuaState::lua_gettop = 0;
1717ptr_lua_settop LuaState::lua_settop = 0 ;
1818ptr_lua_pcall LuaState::lua_pcall = 0 ;
1919ptr_lua_getfield LuaState::lua_getfield = 0 ;
20+ ptr_lua_pushvalue LuaState::lua_pushvalue = 0 ;
2021ptr_lua_pushlightuserdata LuaState::lua_pushlightuserdata = 0 ;
2122ptr_lua_pushstring LuaState::lua_pushstring = 0 ;
2223ptr_lua_pushnumber LuaState::lua_pushnumber = 0 ;
@@ -61,6 +62,7 @@ LuaState::LuaState(File defaultDir)
6162 lua_settop = ptr_lua_settop (dll->getFunction (" lua_settop" ));
6263 lua_pcall = ptr_lua_pcall (dll->getFunction (" lua_pcall" ));
6364 lua_getfield = ptr_lua_getfield (dll->getFunction (" lua_getfield" ));
65+ lua_pushvalue = ptr_lua_pushvalue (dll->getFunction (" lua_pushvalue" ));
6466 lua_pushlightuserdata = ptr_lua_pushlightuserdata (dll->getFunction (" lua_pushlightuserdata" ));
6567 lua_pushstring = ptr_lua_pushstring (dll->getFunction (" lua_pushstring" ));
6668 lua_pushnumber = ptr_lua_pushnumber (dll->getFunction (" lua_pushnumber" ));
@@ -75,7 +77,7 @@ LuaState::LuaState(File defaultDir)
7577 luajit_setmode = ptr_luajit_setmode (dll->getFunction (" luaJIT_setmode" ));
7678#endif
7779 }
78- void *kk[23 ] = {
80+ void *kk[24 ] = {
7981 // cast required for some compilers
8082 (void *)luaL_newstate,
8183 (void *)luaL_openlibs,
@@ -90,6 +92,7 @@ LuaState::LuaState(File defaultDir)
9092 (void *)lua_settop,
9193 (void *)lua_pcall,
9294 (void *)lua_getfield,
95+ (void *)lua_pushvalue,
9396 (void *)lua_pushlightuserdata,
9497 (void *)lua_pushstring,
9598 (void *)lua_pushnumber,
@@ -100,7 +103,7 @@ LuaState::LuaState(File defaultDir)
100103 (void *)lua_isnumber,
101104 (void *)lua_typename,
102105 (void *)lua_newuserdata};
103- for (int i=0 ; i<23 ; i++)
106+ for (int i=0 ; i<24 ; i++)
104107 if (kk[i]==0 ) {
105108 failed = 1 ;
106109 errmsg = " Error: Could not load " + libName +
@@ -161,6 +164,9 @@ int LuaState::pcall(int nargs, int nresults, int errfunc)
161164void LuaState::getfield (int idx, const char *k)
162165{ (*lua_getfield)(l, idx, k);}
163166
167+ void LuaState::pushvalue (int idx)
168+ { (*lua_pushvalue)(l, idx);}
169+
164170void LuaState::pushlightuserdata (void *p)
165171{ (*lua_pushlightuserdata)(l, p);}
166172
0 commit comments