From 2d81cfa4e195a31d92d5ffff313918e4da549a71 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 May 2010 10:50:20 -0300 Subject: corrected definition of 'lua_register' (there is no LUA_ENVIRONINDEX anymore) --- lua.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua.h b/lua.h index ea9d0f17..37525166 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.267 2010/04/12 16:04:10 roberto Exp roberto $ +** $Id: lua.h,v 1.268 2010/04/14 15:14:21 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 @@ -306,8 +306,7 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); #define lua_getglobal(L,s) \ (lua_pushglobaltable(L), lua_getfield(L, -1, (s)), lua_remove(L, -2)) -#define lua_register(L,n,f) \ - (lua_pushcfunction(L, (f)), lua_setfield(L, LUA_ENVIRONINDEX, (n))) +#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) -- cgit v1.2.3-55-g6feb