aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-10-30 19:45:11 +0100
committercbdev <cb@cbcdn.com>2020-10-30 19:45:11 +0100
commitc85ba5aff2d670791589553073e4c519ef1d8434 (patch)
tree3052cc5d13aed445c15b8fed14ff6936f9793173 /backends
parentbb122923379f3439c62241652b82ed403ad835f7 (diff)
downloadmidimonster-c85ba5aff2d670791589553073e4c519ef1d8434.tar.gz
midimonster-c85ba5aff2d670791589553073e4c519ef1d8434.tar.bz2
midimonster-c85ba5aff2d670791589553073e4c519ef1d8434.zip
Update lua backend to 5.4 API changes
Diffstat (limited to 'backends')
-rw-r--r--backends/lua.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/lua.c b/backends/lua.c
index cf59f8f..0a638f7 100644
--- a/backends/lua.c
+++ b/backends/lua.c
@@ -146,7 +146,13 @@ static void lua_thread_resume(size_t current_thread){
//call thread main
DBGPF("Resuming thread %" PRIsize_t " on %s", current_thread, thread[current_thread].instance->name);
+ //the lua_resume API has changed with lua5.4
+ #if LUA_VERSION_NUM > 503
+ int results = 0;
+ thread_status = lua_resume(thread[current_thread].thread, NULL, 0, &results);
+ #else
thread_status = lua_resume(thread[current_thread].thread, NULL, 0);
+ #endif
if(thread_status == LUA_YIELD){
DBGPF("Thread %" PRIsize_t " on %s yielded execution", current_thread, thread[current_thread].instance->name);
@@ -658,6 +664,10 @@ static int lua_start(size_t n, instance** inst){
int default_handler;
channel_value v;
+ #ifdef LUA_VERSION_NUM
+ DBGPF("Lua backend built with %s (%d)", LUA_VERSION, LUA_VERSION_NUM);
+ #endif
+
//resolve channels to their handler functions
for(u = 0; u < n; u++){
data = (lua_instance_data*) inst[u]->impl;