ports/editors/fxite/files/patch-src_fxasq__lua.c
Jason E. Hale 60f61d1988 Fix build with clang 6 (C++11 requires a space between literal and identifier)
Mark FOX17 option broken (Not related to clang 6 in particular, the FOX-1.7
API is ever changing due to being a development version. This project
appears to be dead, so I'm not sure it is worth fixing.)
recorder.cpp:104:9: error: no matching member function for call to 'prepend'
        NewMessage();
        ^~~~~~~~~~~~
recorder.cpp:51:6: note: expanded from macro 'NewMessage'
list.prepend((FXObject*)mm);
~~~~~^~~~~~~
/usr/local/include/fox-1.7/FXObjectList.h:256:10: note: candidate function not viable: no known conversion from 'FX::FXObject *' to 'MacroMessage *' for 1st argument
  FXbool prepend(TYPE* object){ return FXObjectList::prepend(object); }
         ^
/usr/local/include/fox-1.7/FXObjectList.h:265:10: note: candidate function not viable: no known conversion from 'FX::FXObject *' to 'const FXObjectListOf<MacroMessage>' for 1st argument
  FXbool prepend(const FXObjectListOf<TYPE>& objects){ return FXObjectList::prepend(objects); }
         ^
/usr/local/include/fox-1.7/FXObjectList.h:259:10: note: candidate function not viable: requires 2 arguments, but 1 was provided
  FXbool prepend(TYPE* object,FXival n){ return FXObjectList::prepend(object,n); }
         ^
/usr/local/include/fox-1.7/FXObjectList.h:262:10: note: candidate function not viable: requires 2 arguments, but 1 was provided
  FXbool prepend(TYPE** objects,FXival n){ return FXObjectList::prepend(objects,n); }
         ^

Rename/remake patches
2018-02-16 08:12:16 +00:00

50 lines
1.2 KiB
C

--- src/fxasq_lua.c.orig 2013-10-03 09:22:51 UTC
+++ src/fxasq_lua.c
@@ -31,6 +31,9 @@
#include "intl.h"
#include "fxasq_lua.h"
+#if LUA_VERSION_NUM<502
+# define lua_rawlen lua_objlen
+#endif
#define DLG_MODULE_NAME "dialog"
#define MetaName "_fxasq_metatable"
@@ -234,7 +237,7 @@ static int asq_new(lua_State *L) {
if (argc>=2) {
luaL_argcheck(L,lua_istable(L,2),2,_("expected table"));
}
- n=lua_objlen(L,2);
+ n=lua_rawlen(L,2);
for (i=1;i<=n; i++) {
lua_rawgeti(L,2,i);
char msg[64];
@@ -301,7 +304,7 @@ static int asq_done(lua_State *L)
-static const struct luaL_reg asq_funcs[] = {
+static const struct luaL_Reg asq_funcs[] = {
{"new", asq_new},
{"run", asq_run},
{"label", asq_label},
@@ -330,12 +333,15 @@ int luaopen_dialog(lua_State *L)
lua_pushvalue(L, -2);
lua_settable(L, -3);
- luaL_getmetatable(L, MetaName);
lua_pushstring(L,"__gc");
lua_pushcfunction(L,asq_done);
lua_rawset(L,-3);
- luaL_register(L, NULL, &asq_funcs[1]);
- luaL_register(L, DLG_MODULE_NAME, asq_funcs);
- return 0;
+#if LUA_VERSION_NUM < 502
+ luaL_Register(L, NULL, &asq_funcs[1]);
+ luaL_Register(L, DLG_MODULE_NAME, asq_funcs);
+#else
+ luaL_setfuncs(L,asq_funcs,0);
+#endif
+ return 1;
}