From 4f8e92b37b7c20545ca08fefd1f1c0ca7d1673a9 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 27 Nov 2024 18:14:32 +0100 Subject: Make lanes.register() available as an exported C function lanes_register() --- src/lanes.cpp | 4 ++-- src/lanes.hpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lanes.cpp b/src/lanes.cpp index 39caee9..d58f113 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp @@ -213,7 +213,7 @@ LUAG_FUNC(require) // --- If a client wants to transfer stuff of a previously required module from the current state to another Lane, the module must be registered // to populate the lookup database in the source lane (and in the destination too, of course) // lanes.register( "modname", module) -LUAG_FUNC(register) +int lanes_register(lua_State* const L_) { std::string_view const _name{ luaG_checkstring(L_, StackIndex{ 1 }) }; LuaType const _mod_type{ luaG_type(L_, StackIndex{ 2 }) }; @@ -649,7 +649,7 @@ namespace { { "linda", LG_linda }, { "nameof", LG_nameof }, { "now_secs", LG_now_secs }, - { "register", LG_register }, + { "register", lanes_register }, { "set_singlethreaded", LG_set_singlethreaded }, { "set_thread_priority", LG_set_thread_priority }, { "set_thread_affinity", LG_set_thread_affinity }, diff --git a/src/lanes.hpp b/src/lanes.hpp index a3731e4..550e6e6 100644 --- a/src/lanes.hpp +++ b/src/lanes.hpp @@ -18,3 +18,5 @@ LANES_API int luaopen_lanes_core(lua_State* L_); LANES_API void luaopen_lanes_embedded(lua_State* L_, lua_CFunction luaopen_lanes_); using luaopen_lanes_embedded_t = void (*)(lua_State* L_, lua_CFunction luaopen_lanes_); static_assert(std::is_same_v, "signature changed: check all uses of luaopen_lanes_embedded_t"); + +LANES_API int lanes_register(lua_State* L_); -- cgit v1.2.3-55-g6feb