From 2e5179259655ffd137067f5dc47803740b7937ac Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 11 Dec 2009 11:40:44 -0200 Subject: avoid using deprecated macros lua_[gs]etglobal --- lua.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index ead8422b..9cf92660 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.251 2009/11/25 15:27:51 roberto Exp roberto $ +** $Id: lua.h,v 1.252 2009/11/26 11:39:20 roberto Exp roberto $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -297,7 +297,8 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); #define lua_newtable(L) lua_createtable(L, 0, 0) -#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) +#define lua_register(L,n,f) \ + (lua_pushcfunction(L, (f)), lua_setfield(L, LUA_GLOBALSINDEX, (n))) #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) -- cgit v1.2.3-55-g6feb