summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2006-10-09 17:22:32 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2006-10-09 17:22:32 +0000
commit71d5c65e28e9a735b18a000cd1ee19e7f67b4db9 (patch)
tree1a54a7b26cdd75b1f3caaf4439e98059859caab9 /src/plugins/scripts/lua
parentb49ed70af493e513830e891788477cdf20574e93 (diff)
downloadweechat-71d5c65e28e9a735b18a000cd1ee19e7f67b4db9.zip
Adding Lua 5.1 support, display plugins interpreter versions on configure
Diffstat (limited to 'src/plugins/scripts/lua')
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index b8d14cc85..89405e16a 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -1942,16 +1942,24 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
return 0;
}
+#ifdef LUA_VERSION_NUM /* LUA_VERSION_NUM is defined only in lua >= 5.1.0 */
+ luaL_openlibs (lua_current_interpreter);
+#else
luaopen_base (lua_current_interpreter);
- luaopen_table (lua_current_interpreter);
- luaopen_io (lua_current_interpreter);
luaopen_string (lua_current_interpreter);
+ luaopen_table (lua_current_interpreter);
luaopen_math (lua_current_interpreter);
+ luaopen_io (lua_current_interpreter);
luaopen_debug (lua_current_interpreter);
+#endif
luaL_openlib (lua_current_interpreter, "weechat", weechat_lua_funcs, 0);
-
+
+#ifdef LUA_VERSION_NUM
+ if (luaL_dostring (lua_current_interpreter, weechat_lua_code) != 0)
+#else
if (lua_dostring (lua_current_interpreter, weechat_lua_code) != 0)
+#endif
plugin->print_server (plugin,
"Lua warning: unable to redirect stdout and stderr");