mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12:00
Improve dynamic_library
This commit is contained in:
parent
18f9781ea8
commit
a7c34123a6
1 changed files with 14 additions and 2 deletions
|
@ -63,14 +63,26 @@ namespace utils
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Caller
|
void init()
|
||||||
R operator()(Args... args)
|
|
||||||
{
|
{
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
{
|
{
|
||||||
// TODO: atomic
|
// TODO: atomic
|
||||||
ptr = reinterpret_cast<R(*)(Args...)>(get_proc_address(lib, name));
|
ptr = reinterpret_cast<R(*)(Args...)>(get_proc_address(lib, name));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
operator bool()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caller
|
||||||
|
R operator()(Args... args)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
|
||||||
return ptr(args...);
|
return ptr(args...);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue