|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Full-automation entry point for the LuaBridge3 Lua rod: the expansion behind WELDER_MODULE(ns, luabridge). More...
Go to the source code of this file.
Macros | |
| #define | WELDER_DETAIL_LUAOPEN_EXPORT __attribute__((visibility("default"))) |
| Export decoration for the emitted luaopen_<ns> symbol (platform-conditional by necessity, like pybind11's/nanobind's own entry-point export macros). | |
| #define | WELDER_DETAIL_MODULE_ENTRY_luabridge(ns, ...) |
| LuaBridge3's expansion of the backend-agnostic WELDER_MODULE(ns, luabridge). | |
Full-automation entry point for the LuaBridge3 Lua rod: the expansion behind WELDER_MODULE(ns, luabridge).
Include this (instead of rod.hpp) when you want welder to emit the module's luaopen_ entry symbol too, so no hand-written glue appears in user code:
Definition in file module.hpp.
| #define WELDER_DETAIL_LUAOPEN_EXPORT __attribute__((visibility("default"))) |
Export decoration for the emitted luaopen_<ns> symbol (platform-conditional by necessity, like pybind11's/nanobind's own entry-point export macros).
On Windows any explicit dllexport elsewhere in the TU — e.g. nanobind's headers, when a multi-language header is shared across rods — disables MinGW's export-everything default, so the entry symbol must be exported explicitly or require fails with "the specified procedure could not be found". On ELF/Mach-O it pins default visibility, so a TU compiled with -fvisibility=hidden (common in Python-extension builds) still exposes it.
Definition at line 31 of file module.hpp.
| #define WELDER_DETAIL_MODULE_ENTRY_luabridge | ( | ns, | |
| ... ) |
LuaBridge3's expansion of the backend-agnostic WELDER_MODULE(ns, luabridge).
Emits the luaopen_<ns> C entry point Lua's require calls. LuaBridge3 registers into named namespaces under the global table, so welder builds the module under _G["<ns>"], runs the optional trailing { } block as post-glue (the module handle named module in scope), then returns that table to Lua and clears the _G binding (so require yields the table without leaving a global behind). The block is supplied as the body of a forward-declared, internally- linked glue function (the technique the other rods' entry macros use), so both WELDER_MODULE(ns, luabridge) { … } and {} work. Defined at file scope (macros ignore namespaces); see <welder/module.hpp>.
| ns | the namespace / module name token (doubles as the luaopen_ symbol). |
| ... | optionally, the exact welder::welder<…> type to weld with (must be over a LuaBridge3-module rod) — see WELDER_MODULE. |
Definition at line 51 of file module.hpp.