From acd1c05d7416ab80f3ba2056122afe72875fc66b Mon Sep 17 00:00:00 2001 From: Marc Payne Date: Fri, 21 Aug 2015 01:56:37 -0600 Subject: [PATCH] Fix compile error with Lua 5.3 lua_gettable returns an int instead of void in Lua 5.3, so provide a backwards-compatible overload of safe_misc_trampoline to account for this. Tested with Lua 5.2 and 5.3. This change does not address other compilation issues related to Lua bindings for cairo, imlib2, and rsvg. Fixes #90 and part of #100. --- src/luamm.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/luamm.cc b/src/luamm.cc index 8973aac2..71eaab26 100644 --- a/src/luamm.cc +++ b/src/luamm.cc @@ -171,6 +171,14 @@ namespace lua { return nresults; } + // Overloaded for Lua 5.3+ as lua_gettable and others return an int + template + int safe_misc_trampoline(lua_State *l) + { + misc(l, 1); + return nresults; + } + int safe_next_trampoline(lua_State *l) { int r = lua_next(l, 1);