Olaf Hering
2012-Nov-23 19:20 UTC
[Libguestfs] [PATCH] lua: fix build error due to LUA_GLOBALSINDEX usage
lua 5.2 changed API, LUA_GLOBALSINDEX is no longer available. http://www.lua.org/manual/5.2/manual.html#8.3 Signed-off-by: Olaf Hering <olaf at aepfle.de> --- Fix is only compile tested. generator/lua.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/lua.ml b/generator/lua.ml index 88748ae..7461cbd 100644 --- a/generator/lua.ml +++ b/generator/lua.ml @@ -723,7 +723,7 @@ push_int64_array (lua_State *L, const int64_t *array, size_t len) static void print_any (lua_State *L, int index, FILE *out) { - lua_getfield (L, LUA_GLOBALSINDEX, \"tostring\"); + lua_getglobal(L, \"tostring\"); lua_pushvalue (L, index >= 0 ? index : index-1); lua_call (L, 1, 1); fprintf (out, \"%%s\", luaL_checkstring (L, -1)); -- 1.8.0
Richard W.M. Jones
2012-Nov-23 21:44 UTC
[Libguestfs] [PATCH] lua: fix build error due to LUA_GLOBALSINDEX usage
On Fri, Nov 23, 2012 at 08:20:13PM +0100, Olaf Hering wrote:> lua 5.2 changed API, LUA_GLOBALSINDEX is no longer available. > http://www.lua.org/manual/5.2/manual.html#8.3 > > Signed-off-by: Olaf Hering <olaf at aepfle.de> > --- > > Fix is only compile tested. > > generator/lua.ml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/generator/lua.ml b/generator/lua.ml > index 88748ae..7461cbd 100644 > --- a/generator/lua.ml > +++ b/generator/lua.ml > @@ -723,7 +723,7 @@ push_int64_array (lua_State *L, const int64_t *array, size_t len) > static void > print_any (lua_State *L, int index, FILE *out) > { > - lua_getfield (L, LUA_GLOBALSINDEX, \"tostring\"); > + lua_getglobal(L, \"tostring\"); > lua_pushvalue (L, index >= 0 ? index : index-1); > lua_call (L, 1, 1); > fprintf (out, \"%%s\", luaL_checkstring (L, -1)); > -- > 1.8.0Thanks -- I have pushed it, and also confirmed that it works OK with Lua 5.1.4 (not exactly sure why Fedora is still shipping the older version ...) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
Apparently Analagous Threads
- install errors for libguestfs-1.19.60
- [Bridge] [PATCH iproute2-next 1/1] iplink: bridge: Add support for bridge FDB learning limits
- [Bridge] [PATCH iproute2-next v3] iplink: bridge: Add support for bridge FDB learning limits
- extensions.lua with luasql.mysql.
- [Bridge] [PATCH iproute2-next v5] iplink: bridge: Add support for bridge FDB learning limits