Is it possible to dynamically load a @safe function from a shared library ?
aldacron at gmail.com
Fri Mar 13 17:05:32 UTC 2020
On Friday, 13 March 2020 at 16:11:53 UTC, wjoe wrote:
> On Friday, 13 March 2020 at 16:04:06 UTC, Mike Parker wrote:
>> On Friday, 13 March 2020 at 15:16:06 UTC, wjoe wrote:
>>> bindSymbol(&apiVersion, "VersionOfAPI");
>>> Is it possible to convince the compiler to look the other way
>>> while binding @safe functions from the plugin ?
>> It probably has nothing to do with @safe, but is because of
>> the void**.
>> bindSymbol(cast(void**)&apiVersion, "VersionOfAPI");
> Than works, thanks :)
> But isn't apiVersion a function pointer ?
Yes, but when you take the address of *any* kind of pointer, you
can't assign it to void** without a cast.
More information about the Digitalmars-d-learn