|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Full-automation entry point for the sol2 Lua rod: the expansion behind WELDER_MODULE(ns, sol2). 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_sol2(ns, ...) |
| sol2's expansion of the backend-agnostic WELDER_MODULE(ns, sol2). | |
Full-automation entry point for the sol2 Lua rod: the expansion behind WELDER_MODULE(ns, sol2).
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 32 of file module.hpp.
| #define WELDER_DETAIL_MODULE_ENTRY_sol2 | ( | ns, | |
| ... ) |
sol2's expansion of the backend-agnostic WELDER_MODULE(ns, sol2).
Emits the luaopen_<ns> C entry point Lua's require calls: it views the borrowed lua_State* with a sol::state_view, creates the module table, welds namespace ^^ns into it, runs the optional trailing { } block as post-glue (with the module table named module in scope), and returns the table to Lua. The block is supplied as the body of a forward-declared, internally-linked glue function (the technique the Python backends' entry macros use), so both WELDER_MODULE(ns, sol2) { … } and WELDER_MODULE(ns, sol2) {} 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 sol2-module rod) — see WELDER_MODULE. |
Definition at line 51 of file module.hpp.