From 187bda5d48ab55a6508f2d95bd9fa0d88bf9d172 Mon Sep 17 00:00:00 2001 From: zhangjiequan Date: Tue, 20 Feb 2024 18:52:27 +0800 Subject: [PATCH 1/2] feat: Add new macro LUA_NUMTAGS since lua 5.2 --- emmy_debugger/include/emmy_debugger/api/lua_api_loader.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emmy_debugger/include/emmy_debugger/api/lua_api_loader.h b/emmy_debugger/include/emmy_debugger/api/lua_api_loader.h index a252459..9b547cb 100644 --- a/emmy_debugger/include/emmy_debugger/api/lua_api_loader.h +++ b/emmy_debugger/include/emmy_debugger/api/lua_api_loader.h @@ -62,6 +62,9 @@ typedef ptrdiff_t lua_KContext; #define LUA_TUSERDATA 7 #define LUA_TTHREAD 8 +#define LUA_NUMTAGS 9 + + /* ** Type for C functions registered with Lua */ From 93193a5ecdb4b3eea02c8f408d3323ec6267ae66 Mon Sep 17 00:00:00 2001 From: zhangjiequan Date: Tue, 20 Feb 2024 18:57:29 +0800 Subject: [PATCH 2/2] refactor: Replace hard-coded LUA_TTHREAD+1 with LUA_NUMTAGS macro to improve readability --- emmy_debugger/include/emmy_debugger/debugger/emmy_debugger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emmy_debugger/include/emmy_debugger/debugger/emmy_debugger.h b/emmy_debugger/include/emmy_debugger/debugger/emmy_debugger.h index 477ab7b..8ad2e62 100644 --- a/emmy_debugger/include/emmy_debugger/debugger/emmy_debugger.h +++ b/emmy_debugger/include/emmy_debugger/debugger/emmy_debugger.h @@ -143,5 +143,5 @@ class Debugger: public std::enable_shared_from_this Arena *arenaRef; - std::bitset registeredTypes; + std::bitset registeredTypes; };