Enums, bitfields and wl_arrays

Bill Spitzak spitzak at gmail.com
Tue Oct 13 10:19:43 PDT 2015


On 10/13/2015 08:18 AM, Erik De Rijcke wrote:

> Because Java is not C/C++. In Java, enum values are unique by instance
> alone. It does not have user 'defined' value(s) that make it unique. It
> *can* have user defined properties (like any object) in addition to
>   implicit compiler generated enum type specific properties. One of
> those properties is it's "ordinal". Change the order of the enums and
> the ordinal property will change, which can cause undefined behavior.
> Now you need to wonder no more. :)

The language binding should sort the enum by numerical value and use 
that to determine the ordinal number. Ie it is based on the numerical 
value, not on the location in the xml file.



More information about the wayland-devel mailing list