enforce ctx in constructor

Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2025-10-20 00:43:10 +03:00
1 parent c2f423e4a5
commit 9abecd9fe9
3 files changed
+29 -22

No files matched your search

+5 -8
View File
@@ -8,15 +8,12 @@ namespace vl::mod {
// Registration record stored in the module's custom section.
// Core will scan this in the loaded .so to find available mods.
struct Registration {
// magic helps Core validate the record
const void* magic;
// factory that constructs a ModBase-derived object with Context
std::unique_ptr<Base> (*factory)(const Context&);
// an optional RTTI-ish string (e.g., typeid(T).name())
const char* typeName;
const char* typeName; // e.g., typeid(T).name()
const char* name; // COMPILE-TIME mod name (from T::Name())
const char* version; // COMPILE-TIME mod version (from T::Version())
};
inline constexpr std::uintptr_t kModRegMagicValue = 0xBADC0FFEEULL;
inline const void* kModRegMagic = reinterpret_cast<const void*>(kModRegMagicValue);
inline constexpr std::uintptr_t kModRegMagicRaw = 0xBADC0FFEEULL;
inline const void* kModRegMagic = reinterpret_cast<const void*>(kModRegMagicRaw);
} // namespace vl::log