[Xcb] RFC: Altenum updates for xcb/proto

Peter Harris pharris at opentext.com
Wed Feb 25 16:20:31 PST 2009


Barton C Massey wrote:
> In message <49A5C65E.7010508 at opentext.com> you wrote:
>>
>> It generates enums like:
>>
>> typedef enum xcb_window_enum {
>>   XCB_WINDOW_NONE = 0
>> } xcb_window_enum;
> 
> This isn't bad.  I'd probably just generate something like
> 
>   static const xid_t XCB_WINDOW_NONE = 0;
> 
> and call it a day, though.

The attached (which took rather longer to write) does that.

Unstripped .so files are noticeably larger, but stripping them seems to
end up at the same size either way.

This also closes the door to using the <field enum= > annotations to
generate function prototypes that reference the enum (to help out smart
editors that suggest values). Meh. Although the API wouldn't break
(further) in a noticeable way, I suppose it could be a potential ABI
breakage on some platforms anyway.

Comments welcome.

http://cgit.freedesktop.org/~peterh/libxcb-enum/ - master is the
previous patch, no-c-enum is this patch, for those who prefer their
patches colourized.

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://www.opentext.com/connectivity
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Don-t-use-enums-in-generated-C-code-use-integer-co.patch
Url: http://lists.freedesktop.org/archives/xcb/attachments/20090225/d65797fd/attachment.ksh 


More information about the Xcb mailing list