On Sunday, 2 August 2015 at 15:38:34 UTC, Mike Parker wrote:
You have to declare it as a pointer, then retrieve the pointer in the same way you do the function pointers, via the system loader (GetProcAddress/dlsym).

and how would you make this source compatible with the static binding version?
I guess it is not possible

extern(C):
version(Dynamic) {
    __gshared wl_interface *wl_display_interface;
}
else {
    extern __gshared wl_interface wl_display_interface;
}


// use case: some_func expects a pointer to wl_interface
// the C version is using addressof operator, (as do the static D bindings)
some_func(&wl_display_interface);

Reply via email to