How fwrd-compatible is using dlopen and core only?

ferreiradaselva ferreiradaselva at
Fri Aug 10 16:41:53 UTC 2018


For the OSS window framework that I'm working on, the Wayland backend requires linking to the libraries. No problem here.

I wish to give an option to load the Wayland libraries at runtime, using `dlopen()`. The problem is that some functions are inline'd in the headers or part of the extension protocol, but also inline'd.

1. `wl_registry_add_listener` from `wayland-client-protocol.h`
2. `xdg_surface_ack_configure` from `xdg-shell.h`

My question is, how forward compatible my library would be if instead of including those headers, I copy-paste the body content of these functions?

Example, I would copy-paste this content from `wl_registry_add_listener` directly to my library:

    return wl_proxy_add_listener((struct wl_proxy *) wl_registry, (void (**)(void)) listener, data);

Since `wl_proxy_add_listener` is a function that I can actually get the pointer using `dlopen()/dlsym()`, I wouldn't require any header.

Thanks for the attention,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wayland-devel mailing list