Enums, bitfields and wl_arrays

Pekka Paalanen ppaalanen at gmail.com
Fri Oct 2 06:16:23 PDT 2015


On Fri, 2 Oct 2015 13:50:42 +0100
Auke Booij <auke at tulcod.com> wrote:

> Maybe a solution can be found in more languages, and we can make the
> compatibility, that e.g. Pekka is looking for, a requirement for
> bindings, rather than make compatibility a requirement for the
> protocol writers. So something along these lines would be in the
> specification:
> 
> [start]
> The enum and bitfield attributes are in principle for documentation
> purposes only. The enum and bitfield attributes may also be used by
> bindings, but only in such a way that code written prior to the
> specification of these attributes still works after their
> specification. In other words, specifying an attribute for an
> argument, that previously did not have it, should not break API.
> [end]
> 
> Obviously C is not rich enough to do this in an elegant way. (Maybe
> it's possible in C++ with some template magic?) But it definitely
> solves the "backwards compatibility" debate, since, while anyone is
> free to ignore this bit in the specification, solutions might
> sometimes be possible, and it guards the entire C world from issues in
> the non-C bindings.

Hi Auke,

I like this very much. Let's see if anyone disagrees.

Do you intend to allow also changing rather than only adding these new
attributes in the wording above?

I read it as no, and I suppose that's good. We'd have that anyway. The
"do not use this or you get to keep all pieces" wording I used was
perhaps too liberal.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151002/44957d03/attachment.sig>


More information about the wayland-devel mailing list