Referencing enums in other protocols

Auke Booij auke at tulcod.com
Tue May 1 10:18:08 UTC 2018


On Mon, Apr 23, 2018 at 9:08 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Mon, 23 Apr 2018 03:42:31 -0400
> Simon Ser <contact at emersion.fr> wrote:
>
>> Hi all,
>>
>> While writing a protocol, I've been trying to reference symbols from another
>> protocol. While it seems to work fine for interfaces, it fails for enums:
>>
>>     error: could not find enumeration wl_output.transform
>>
>> Is this by design? It seems odd to me that interfaces work but enums don't.
>
> Hi,
>
> I think that's an oversight. It should indeed be possible to reference
> enums just like interfaces from other protocol files.

>From my point of view, we did not add this when we were working on
cross-referencing enums, in order to to keep the change as simple as
possible and easy to understand. Now that (apparently) there is a use
case, a solution would be welcome. But there are some problems to
solve. How do you specify the right version of an enum in another
file? What do you do if you want to refer to an enum in a protocol
file that is not available? At what point DO we check that the
cross-referenced enum exists? (Leaving it up to the protocol file
writer to do correctly sounds prone to error.) Etcetera.


More information about the wayland-devel mailing list