[waffle] [PATCH 01/29] wayland: add wl_proxy_create wrapper

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 7 15:24:05 UTC 2016


On 6 April 2016 at 13:20, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 6 January 2016 at 21:27, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> libwayland has broken its ABI by replacing wl_proxy_create +
>> wl_proxy_marshal with wfl_wl_proxy_marshal_constructor with commit
s/wfl_wl_proxy_marshal_constructor/wl_proxy_marshal_constructor/

>> 853c24e6998(client: Introduce functions to allocate and marshal proxies
>> atomically).
>>
>> Add the wrapper to keep compatibility with wayland 1.3.90 and earlier.
>>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>  src/waffle/wayland/wayland_wrapper.h | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/src/waffle/wayland/wayland_wrapper.h b/src/waffle/wayland/wayland_wrapper.h
>> index 40a581a..e2c96ca 100644
>> --- a/src/waffle/wayland/wayland_wrapper.h
>> +++ b/src/waffle/wayland/wayland_wrapper.h
>> @@ -66,6 +66,10 @@ int
>>  (*wfl_wl_proxy_add_listener)(struct wl_proxy *proxy,
>>                               void (**implementation)(void), void *data);
>>
>> +struct wl_proxy *
>> +(*wfl_wl_proxy_create)(struct wl_proxy *factory,
>> +                       const struct wl_interface *interface);
>> +
>>  void
>>  (*wfl_wl_proxy_marshal)(struct wl_proxy *p, uint32_t opcode, ...);
>>
>> @@ -90,5 +94,6 @@ struct wl_proxy *
>>  #define wl_display_roundtrip (*wfl_wl_display_roundtrip)
>>  #define wl_proxy_destroy (*wfl_wl_proxy_destroy)
>>  #define wl_proxy_add_listener (*wfl_wl_proxy_add_listener)
>> +#define wl_proxy_create (*wfl_wl_proxy_create)
>>  #define wl_proxy_marshal (*wfl_wl_proxy_marshal)
>>  #define wl_proxy_marshal_constructor (*wfl_wl_proxy_marshal_constructor)
>
> A small note I had lying around - XXX: Double check that it works
> (might need the following hunk).
>
>
> diff --git a/src/waffle/wayland/wayland_wrapper.c
> b/src/waffle/wayland/wayland_wrapper.c
> index 6ffd5a9..729f860 100644
> --- a/src/waffle/wayland/wayland_wrapper.c
> +++ b/src/waffle/wayland/wayland_wrapper.c
> @@ -104,6 +104,7 @@ wayland_wrapper_init(void)
>     RETRIEVE_WL_CLIENT_SYMBOL(wl_display_roundtrip);
>     RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_destroy);
>     RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_add_listener);
> +    RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_create);
>     RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_marshal);
>     RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_marshal_constructor);
> #undef RETRIEVE_WL_CLIENT_SYMBOL
>
So yes, in order for this to work on older platforms we need the hunk,
plus we must make the dlsym(... "wl_proxy_marshal_constructor") non
fatal. This way even if the symbol is missing (in case of old
libwayland) we don't care as it won't be used.

The alternative is to bump the requirement to 1.4 although not many
platforms have/use it. I would opt for using the workaround for now
(perhaps with a comment).

How would others feel on the topic ?

-Emil


More information about the waffle mailing list