fixes lua 5.2 compile
authorPeng Wu <alexepico@gmail.com>
Wed, 31 Jul 2013 02:53:14 +0000 (10:53 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 31 Jul 2013 03:01:29 +0000 (11:01 +0800)
lua/lua-plugin-init.c
lua/lua-plugin.c

index b607b2a..8e95286 100644 (file)
 
 #include "lua-plugin.h"
 
+#if LUA_VERSION_NUM >= 502
+/* ugly hack for lua 5.2 */
+
+#define lua_objlen lua_rawlen
+
+#endif
+
+
 static const luaL_Reg lualibs[] = {
   {"", luaopen_base},
   {LUA_TABLIBNAME, luaopen_table},
index 9fd36fb..5ccb837 100644 (file)
 
 #include "lua-plugin.h"
 
+#if LUA_VERSION_NUM >= 502
+/* ugly hack for lua 5.2 */
+
+#define lua_open luaL_newstate
+
+#define lua_objlen lua_rawlen
+
+#endif
+
 #define IBUS_ENGINE_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), IBUS_TYPE_ENGINE_PLUGIN, IBusEnginePluginPrivate))
 
 struct _IBusEnginePluginPrivate{