[PATCH wayland 2/3] scanner: Allow adding a prefix to exported symbols

Jonas Ådahl jadahl at gmail.com
Tue Jul 25 07:25:58 UTC 2017


On Mon, Jul 24, 2017 at 02:16:04PM +0300, Pekka Paalanen wrote:
> On Mon,  3 Jul 2017 17:16:45 +0800
> Jonas Ådahl <jadahl at gmail.com> wrote:
> 
> > Two different protocols may use interfaces with identical names.
> > Implementing support for both those protocols would result in symbol
> > clashes, as wayland-scanner generates symbols from the interface names.
> > 
> > Make it possible to avoiding these clashes by adding a way to add a
> > prefix to the symbols generated by wayland-scanner. Implementations
> > (servers and clients) can then use these prefix:ed symbols to implement
> > different objects with the same name.
> > 
> > Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> > ---
> > 
> > Something like this would be needed if a compositor/client wants to implement
> > xdg-shell unstable v5 alongside xdg-shell stable, unless we want to rename all
> > our xdg-shell interfaces. Implementing xdg-shell unstable v6 alongside
> > xdg-shell stable does not have this issue.
> > 
> > See issue raised here:
> > https://lists.freedesktop.org/archives/wayland-devel/2017-June/034380.html
> > 
> > 
> > Jonas
> > 
> > 
> >  src/scanner.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++-------------
> >  1 file changed, 73 insertions(+), 21 deletions(-)
> 
> 
> Hi,
> 
> while this seems to change the ABI symbol names, it does not change the
> names in the documentation, and it does not change the names of
> #defines of enums, or the inline functions. That means that this is not
> enough to fulfill the purpose: being able to use two similarly named
> but different protocols by adding a prefix.

The idea I had was rather that one would avoid changing any names on
non-symbols. It'd still be possible to implement both by doing it in
separate C files. I can see the point in adding the prefix on everything
though, so I'll provide a patch for that.


Jonas

> 
> For the idea:
> Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> But I think it needs to apply the prefix to *everything*, both ABI and
> API.
> 
> 
> Thanks,
> pq




More information about the wayland-devel mailing list