aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-11-27 18:14:32 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-11-27 18:14:32 +0100
commit4f8e92b37b7c20545ca08fefd1f1c0ca7d1673a9 (patch)
tree3dda322bc32cc49f53c8399a5bb03b04bf616cdc /src
parent95d8604d0822b32f2561c5b29f18acf909ead935 (diff)
downloadlanes-4f8e92b37b7c20545ca08fefd1f1c0ca7d1673a9.tar.gz
lanes-4f8e92b37b7c20545ca08fefd1f1c0ca7d1673a9.tar.bz2
lanes-4f8e92b37b7c20545ca08fefd1f1c0ca7d1673a9.zip
Make lanes.register() available as an exported C function lanes_register()
Diffstat (limited to 'src')
-rw-r--r--src/lanes.cpp4
-rw-r--r--src/lanes.hpp2
2 files changed, 4 insertions, 2 deletions
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)
213// --- If a client wants to transfer stuff of a previously required module from the current state to another Lane, the module must be registered 213// --- If a client wants to transfer stuff of a previously required module from the current state to another Lane, the module must be registered
214// to populate the lookup database in the source lane (and in the destination too, of course) 214// to populate the lookup database in the source lane (and in the destination too, of course)
215// lanes.register( "modname", module) 215// lanes.register( "modname", module)
216LUAG_FUNC(register) 216int lanes_register(lua_State* const L_)
217{ 217{
218 std::string_view const _name{ luaG_checkstring(L_, StackIndex{ 1 }) }; 218 std::string_view const _name{ luaG_checkstring(L_, StackIndex{ 1 }) };
219 LuaType const _mod_type{ luaG_type(L_, StackIndex{ 2 }) }; 219 LuaType const _mod_type{ luaG_type(L_, StackIndex{ 2 }) };
@@ -649,7 +649,7 @@ namespace {
649 { "linda", LG_linda }, 649 { "linda", LG_linda },
650 { "nameof", LG_nameof }, 650 { "nameof", LG_nameof },
651 { "now_secs", LG_now_secs }, 651 { "now_secs", LG_now_secs },
652 { "register", LG_register }, 652 { "register", lanes_register },
653 { "set_singlethreaded", LG_set_singlethreaded }, 653 { "set_singlethreaded", LG_set_singlethreaded },
654 { "set_thread_priority", LG_set_thread_priority }, 654 { "set_thread_priority", LG_set_thread_priority },
655 { "set_thread_affinity", LG_set_thread_affinity }, 655 { "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_);
18LANES_API void luaopen_lanes_embedded(lua_State* L_, lua_CFunction luaopen_lanes_); 18LANES_API void luaopen_lanes_embedded(lua_State* L_, lua_CFunction luaopen_lanes_);
19using luaopen_lanes_embedded_t = void (*)(lua_State* L_, lua_CFunction luaopen_lanes_); 19using luaopen_lanes_embedded_t = void (*)(lua_State* L_, lua_CFunction luaopen_lanes_);
20static_assert(std::is_same_v<decltype(&luaopen_lanes_embedded), luaopen_lanes_embedded_t>, "signature changed: check all uses of luaopen_lanes_embedded_t"); 20static_assert(std::is_same_v<decltype(&luaopen_lanes_embedded), luaopen_lanes_embedded_t>, "signature changed: check all uses of luaopen_lanes_embedded_t");
21
22LANES_API int lanes_register(lua_State* L_);