Closed decuant closed 3 years ago
@decuant, what's the error you are getting?
The fix you are proposing is insufficient, as there has to be the else
part to that if
check, but I'm not yet sure what it should be.
@decuant, lua_cpcall
is deprecated in lua 5.2+, but there is a define
in wxldefs.h that is supposed to compensate for that. It doesn't seem to be used in your case, that's why I'm curious what error you are getting.
C:\wxlua-master\wxLua\modules\wxlua\wxlstate.cpp(1871): error C3861: 'lua_cpcall': identifier not found
I have reverted code back to get the error. Is at line 1871 of wxlstate.cpp.
With find in files this call is defined in wxldefs.h (it is the file I used as hint for solving the problem, since it mentions Lua 5.2).
Your point is correct (about versioning).
@decuant, can you try the following patch:
diff --git a/wxLua/modules/wxlua/wxldefs.h b/wxLua/modules/wxlua/wxldefs.h
index a9c5161..572a045 100644
--- a/wxLua/modules/wxlua/wxldefs.h
+++ b/wxLua/modules/wxlua/wxldefs.h
@@ -40,12 +40,14 @@ extern "C"
#endif
// These are #defined with LUA_COMPAT_ALL (but we don't require that)
- #ifndef lua_strlen
+ #ifndef lua_strlen
#define lua_strlen(L,i) lua_rawlen(L, (i))
#define lua_objlen(L,i) lua_rawlen(L, (i))
#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT)
+ #endif
+ #ifndef lua_cpcall
#define lua_cpcall(L,f,u) (lua_pushcfunction(L, (f)), \
lua_pushlightuserdata(L,(u)), \
lua_pcall(L,1,0,0))
Hi Paul,
you fixed this error, very good. I tested the new wx.dll just to make sure.... and you can close the ticket.
Just before leaving, I wanted to say that I feel lost without ZeroBrane, I don't know how to insert a menu entry to switch interpreter to be 5.4.2. Please consider adding support for it.
Thank you again
Pushed the changes. Lua 5.4 support is coming; you can track it in https://github.com/pkulchenko/ZeroBraneStudio/issues/1075.
Hi Paul,
I was compiling all the whole lot to get Lua 5.4.2 and latest wxWidgets 3.0.1.4 against your wxLua 3.1.0.0, but it fails.
The correction has to be made in file wxlstate.cpp
----> moved lua_CPCall from outside to inside define check 502 <---------
Can you please have a look and possibly fix for everybody?
I have built wx.dll for 64bit correctly with this fix.
Ciao
Antonio