1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

lua: fix boolean return value (as integer) in API functions

This commit is contained in:
Sébastien Helleu
2017-10-03 21:17:22 +02:00
parent 255e46eaef
commit 7949146687
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -67,8 +67,12 @@
plugin_script_str2ptr (weechat_lua_plugin, \
LUA_CURRENT_SCRIPT_NAME, \
lua_function_name, __string)
#define API_RETURN_OK return 1
#define API_RETURN_ERROR return 0
#define API_RETURN_OK \
lua_pushinteger (L, 1); \
return 1
#define API_RETURN_ERROR \
lua_pushinteger (L, 0); \
return 1
#define API_RETURN_EMPTY \
lua_pushstring (L, ""); \
return 0