Enums, bitfields and wl_arrays
Pekka Paalanen
ppaalanen at gmail.com
Mon Oct 12 02:08:12 PDT 2015
On Mon, 12 Oct 2015 10:41:22 +0200
Erik De Rijcke <derijcke.erik at gmail.com> wrote:
> Adding enum members is backward compatible for Java. If you compile against
> an enum with 2 members, and later on a new member is added, you can simply
> use the new version of the enum.
>
> Important however is that the order of old members do not change when new
> members are added.
This is important. I don't think anyone has ever mentioned anything
like this before.
We certainly have not expected the order to matter inside an <enum>
tag, since we require the value to be explicitly given. Not when you
are coming from C, anyway.
Apparently we would need to start enforcing the rule:
"Only ever add new enum value to the end of a closed enum."
Yeah, now we also need the concept of open and closed enums, because
for something like used in xdg-shell for window states, the whole enum
concept doesn't work e.g. in Java (I hear).
Should we be adding all these to the Wayland XML language or not?
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/20151012/91241465/attachment.sig>
More information about the wayland-devel
mailing list