[PATCH 1/2] scanner: Add --visibility flag for setting symbol visibility
emil.l.velikov at gmail.com
Wed Jul 26 12:14:26 UTC 2017
On 25 July 2017 at 11:39, Jonas Ådahl <jadahl at gmail.com> wrote:
> Add a --visibility flag that enables the user to tweak the visibility
> of the symbols generated by wayland-scanner. Three alternatives are
> 'export': as has always been done up until now, export the symbols
> using WL_EXPORT, making making them exposed externally. This is the
> default in order to not break backward compatibility.
> 'compiler-default': use whatever visibility the compiler defaults to.
> This is most likely the most visibility that protocol implementations
> or users actually wants, as it doesn't expose any unwanted
> implementation details.
> 'static': each symbol will only be visible to the compilation unit it
> is included in. This means that a protocol implementations and users
> needs to include both the 'code' file and either the 'client-header' or
> 'server-header' (or both) in the source file implementing or using the
> protocol in question.
> Using 'static' is a method to avoid situations where otherwise exposed
> symbols of different protocols would conflict, for example if they have
> the same interface name.
> When no visibility is specified, 'export' is assumed, but a warning is
> printed to stderr, as it is unlikely that 'export' is what is actually
I have some patches with similar idea, although different in a number of ways.
Rather than nitpicking like an old bat, I'll rebase mine and send them
out in a couple of hours.
Perhaps people will see some value in the bits I've used there?
More information about the wayland-devel