Path: blob/main/editors/fxite/files/patch-src_luafx.cpp
16461 views
--- src/luafx.cpp.orig 2013-10-03 09:22:51 UTC1+++ src/luafx.cpp2@@ -36,6 +36,10 @@3#include "intl.h"4#include "luafx.h"56+#if LUA_VERSION_NUM<5027+# define lua_rawlen lua_objlen8+#endif9+10static FXWindow*main_window=NULL;1112static const char*default_title;13@@ -173,7 +177,7 @@ static int input(lua_State*L)14switch (toupper(type[0])) {15case 'I' : {16if (!lua_isnil(L,3)) {17- txt.format(sizeof(lua_Integer)>4?"%ld":"%d", luaL_checkinteger(L,3));18+ txt.format("%ld", luaL_checkinteger(L,3));19}20opt=INPUTDIALOG_INTEGER;21break;22@@ -248,7 +252,7 @@ static int choose(lua_State*L) {23FXString fmsg;24int i,n;25luaL_argcheck(L, lua_istable(L,argtbl), argtbl, _("table expected") );26- n=lua_objlen(L,argtbl);27+ n=lua_rawlen(L,argtbl);28luaL_argcheck(L, n>0, argtbl, _("table can't be empty"));29for (i=1;i<=n; i++) {30lua_rawgeti(L,argtbl,i);31@@ -599,7 +603,7 @@ static int pid(lua_State* L)32333435-static const struct luaL_reg fx_util_funcs[] = {36+static const struct luaL_Reg fx_util_funcs[] = {37{"message", message},38{"confirm", confirm},39{"input", input},40@@ -620,7 +624,7 @@ static const struct luaL_reg fx_util_funcs[] = {41424344-const luaL_reg* LuaFxUtils(FXWindow*topwin, const char*exe_name)45+const luaL_Reg* LuaFxUtils(FXWindow*topwin, const char*exe_name)46{47default_title=exe_name;48if (!main_window) { main_window=topwin; }495051