From c85ba5aff2d670791589553073e4c519ef1d8434 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 30 Oct 2020 19:45:11 +0100 Subject: Update lua backend to 5.4 API changes --- backends/lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.3