1 parent
3851aeb703
commit
053ee5b296
23 files changed
+845
-93
No files matched your search
+14
-19
@@ -78,6 +78,19 @@ namespace Void::Plugin
|
||||
return m_pin->info;
|
||||
}
|
||||
|
||||
void* PluginHandle::raw_symbol(const char* symbol) const noexcept
|
||||
{
|
||||
#ifdef VOID_HAS_DLOPEN
|
||||
if (!m_pin || m_pin->handle == nullptr || symbol == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return dlsym(m_pin->handle, symbol);
|
||||
#else
|
||||
(void)symbol;
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ── loading helpers ───────────────────────────────────────────────────
|
||||
|
||||
namespace
|
||||
@@ -589,25 +602,7 @@ namespace Void::Plugin
|
||||
void* PluginManager::raw_symbol(std::string_view name,
|
||||
const char* symbol) const
|
||||
{
|
||||
#ifdef VOID_HAS_DLOPEN
|
||||
std::shared_ptr<detail::Instance> inst;
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
auto* entry = find(name);
|
||||
if (entry == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
inst = entry->current.load(std::memory_order_acquire);
|
||||
}
|
||||
if (!inst || inst->handle == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
return dlsym(inst->handle, symbol);
|
||||
#else
|
||||
(void)name;
|
||||
(void)symbol;
|
||||
return nullptr;
|
||||
#endif
|
||||
return acquire(name).raw_symbol(symbol);
|
||||
}
|
||||
|
||||
} // namespace Void::Plugin
|
||||
Reference in new issue
Block a user