Replacing LUA_GLOBALSINDEX when porting 5.1 libs to 5.2...
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Replacing LUA_GLOBALSINDEX when porting 5.1 libs to 5.2...
- From: duck <duck@...>
- Date: 2010年5月31日 18:03:11 +1000 (EST)
Can this 5.1 code:
lua_getfield(L, LUA_GLOBALSINDEX, name);
be made ready for 5.2 by writing this instead:
lua_pushglobaltable(L);
lua_getfield(L,-1,name);
lua_remove(L,-2);
?
(Apologies if this has been covered before. A mail archive search
suggested it hadn't.)