Bug 79986

Summary: compiler error on AIX in xcb_in.c:339: '_xcb_in' has no member named 'reqevents'
Product: XCB Reporter: Michael Haubenwallner <michael.haubenwallner>
Component: LibraryAssignee: xcb mailing list dummy <xcb>
Status: RESOLVED FIXED QA Contact: xcb mailing list dummy <xcb>
Severity: normal    
Priority: medium    
Version: 1.9.3   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch for libxcb master

Description Michael Haubenwallner 2014-06-13 14:18:41 UTC
Compiling libxcb-1.9.3 on AIX leads to this compiler error (occurs on multiple line numbers):
/tools/haubi/gentoo/sauxz6/var/tmp/portage/x11-libs/libxcb-1.9.3-r1/work/libxcb-1.9.3/src/xcb_in.c: In function 'get_event':
/tools/haubi/gentoo/sauxz6/var/tmp/portage/x11-libs/libxcb-1.9.3-r1/work/libxcb-1.9.3/src/xcb_in.c:339: error: '_xcb_in' has no member named 'reqevents'

While the declaration itself actually is:
  typedef struct _xcb_in {
    ...
    struct event_list *events;
    ...
  } _xcb_in;

Now, <sys/poll.h> does "#define events reqevents", so this is where the name 'reqevents' comes from.

However, in xcb_in.c, <sys/poll.h> is included /after/ "xcbint.h", so the struct _xcb_in declaration itself does not have 'events' redefined yet, while the code later in xcb.in.c does have.
Comment 1 Michael Haubenwallner 2014-06-13 14:22:59 UTC
Created attachment 100981 [details] [review]
patch for libxcb master

The fix here is to include local header files after any system header file.
Comment 2 Alan Coopersmith 2014-06-14 15:28:12 UTC
Thanks for the patch - reviewed & pushed to git master:

To ssh://git.freedesktop.org/git/xcb/libxcb
   bc5a104..1251354  master -> master

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.