[Xcb] C++ problems

Bart Massey bart at cs.pdx.edu
Thu Apr 22 01:38:52 EST 2004


Thanks much for the patch!  Of course, the names we were
using were the official names from the X spec---way older
than C++ :-).  We'll put in an appropriate fix in the next
couple of days.

    Bart

In message <1082546103.19315.12.camel at ion.david> you wrote:
> 
> --=-HAUXeYqrHrte4P33S2aI
> Content-Type: text/plain
> Content-Transfer-Encoding: 7bit
> 
> The xcb headers use C++ reserved words, so if I include xcb.h in my C++
> application g++ fails when compiling.
> 
> This patch only marks out the lines that I needed to change to get it to
> compile, you should of course fix the problem in your own way. There
> might be similar problems with other headers as well, I haven't checked
> those. 
> 
> - David
> 
> -- 
> David Reveman <c99drn at cs.umu.se>
> 
> --=-HAUXeYqrHrte4P33S2aI
> Content-Disposition: attachment; filename=xcb.h.diff
> Content-Type: text/x-patch; name=xcb.h.diff; charset=ANSI_X3.4-1968
> Content-Transfer-Encoding: 7bit
> 
> --- xcb.h.orig	2004-04-20 21:16:59.000000000 +0200
> +++ xcb.h	2004-04-21 13:01:33.802449032 +0200
> @@ -240,7 +240,7 @@
>  
>  typedef struct {
>      XCBVISUALID visual_id;
> -    CARD8 class;
> +    CARD8 clazz; /* CARD8 class; */
>      CARD8 bits_per_rgb_value;
>      CARD16 colormap_entries;
>      CARD32 red_mask;
> @@ -813,7 +813,7 @@
>      CARD16 width;
>      CARD16 height;
>      CARD16 border_width;
> -    CARD16 class;
> +    CARD16 clazz; /* CARD16 class; */
>      XCBVISUALID visual;
>      CARD32 value_mask;
>  } XCBCreateWindowReq;
> @@ -1044,7 +1044,7 @@
>  
>  typedef struct {
>      CARD8 major_opcode;
> -    BOOL delete;
> +    BOOL del; /* BOOL delete; */
>      CARD16 length;
>      XCBWINDOW window;
>      XCBATOM property;
> @@ -2137,7 +2137,7 @@
>  
>  typedef struct {
>      CARD8 major_opcode;
> -    CARD8 class;
> +    CARD8 clazz; /* CARD8 class; */
>      CARD16 length;
>      XCBDRAWABLE drawable;
>      CARD16 width;
> @@ -2602,7 +2602,7 @@
>  XCBSCREENIter XCBConnSetupSuccessRepRoots(XCBConnSetupSuccessRep *R);
>  void XCBConnSetupSuccessRepNext(XCBConnSetupSuccessRepIter *i);
>  void *XCBConnSetupSuccessRepEnd(XCBConnSetupSuccessRepIter i);
> -XCBVoidCookie XCBCreateWindow(XCBConnection *c, CARD8 depth, XCBWINDOW wid, XCBWINDOW parent, INT16 x, INT16 y, CARD16 width, CARD16 height, CARD16 border_width, CARD16 class, XCBVISUALID visual, CARD32 value_mask, const CARD32 *value_list);
> +XCBVoidCookie XCBCreateWindow(XCBConnection *c, CARD8 depth, XCBWINDOW wid, XCBWINDOW parent, INT16 x, INT16 y, CARD16 width, CARD16 height, CARD16 border_width, CARD16 clazz, XCBVISUALID visual, CARD32 value_mask, const CARD32 *value_list); /* XCBVoidCookie XCBCreateWindow(XCBConnection *c, CARD8 depth, XCBWINDOW wid, XCBWINDOW parent, INT16 x, INT16 y, CARD16 width, CARD16 height, CARD16 border_width, CARD16 class, XCBVISUALID visual, CARD32 value_mask, const CARD32 *value_list); */
>  XCBVoidCookie XCBChangeWindowAttributes(XCBConnection *c, XCBWINDOW window, CARD32 value_mask, const CARD32 *value_list);
>  XCBGetWindowAttributesCookie XCBGetWindowAttributes(XCBConnection *c, XCBWINDOW window);
>  XCBGetWindowAttributesRep *XCBGetWindowAttributesReply(XCBConnection *c, XCBGetWindowAttributesCookie cookie, XCBGenericError **e);
> @@ -2630,7 +2630,7 @@
>  XCBGetAtomNameRep *XCBGetAtomNameReply(XCBConnection *c, XCBGetAtomNameCookie cookie, XCBGenericError **e);
>  XCBVoidCookie XCBChangeProperty(XCBConnection *c, CARD8 mode, XCBWINDOW window, XCBATOM property, XCBATOM type, CARD8 format, CARD32 data_len, const void *data);
>  XCBVoidCookie XCBDeleteProperty(XCBConnection *c, XCBWINDOW window, XCBATOM property);
> -XCBGetPropertyCookie XCBGetProperty(XCBConnection *c, BOOL delete, XCBWINDOW window, XCBATOM property, XCBATOM type, CARD32 long_offset, CARD32 long_length);
> +XCBGetPropertyCookie XCBGetProperty(XCBConnection *c, BOOL del, XCBWINDOW window, XCBATOM property, XCBATOM type, CARD32 long_offset, CARD32 long_length); /* XCBGetPropertyCookie XCBGetProperty(XCBConnection *c, BOOL delete, XCBWINDOW window, XCBATOM property, XCBATOM type, CARD32 long_offset, CARD32 long_length); */
>  void *XCBGetPropertyValue(XCBGetPropertyRep *R);
>  int XCBGetPropertyValueLength(XCBGetPropertyRep *R);
>  XCBGetPropertyRep *XCBGetPropertyReply(XCBConnection *c, XCBGetPropertyCookie cookie, XCBGenericError **e);
> @@ -2768,7 +2768,7 @@
>  XCBVoidCookie XCBCreateGlyphCursor(XCBConnection *c, XCBCURSOR cid, XCBFONT source_font, XCBFONT mask_font, CARD16 source_char, CARD16 mask_char, CARD16 fore_red, CARD16 fore_green, CARD16 fore_blue, CARD16 back_red, CARD16 back_green, CARD16 back_blue);
>  XCBVoidCookie XCBFreeCursor(XCBConnection *c, XCBCURSOR cursor);
>  XCBVoidCookie XCBRecolorCursor(XCBConnection *c, XCBCURSOR cursor, CARD16 fore_red, CARD16 fore_green, CARD16 fore_blue, CARD16 back_red, CARD16 back_green, CARD16 back_blue);
> -XCBQueryBestSizeCookie XCBQueryBestSize(XCBConnection *c, CARD8 class, XCBDRAWABLE drawable, CARD16 width, CARD16 height);
> +XCBQueryBestSizeCookie XCBQueryBestSize(XCBConnection *c, CARD8 clazz, XCBDRAWABLE drawable, CARD16 width, CARD16 height); /* XCBQueryBestSizeCookie XCBQueryBestSize(XCBConnection *c, CARD8 class, XCBDRAWABLE drawable, CARD16 width, CARD16 height); */
>  XCBQueryBestSizeRep *XCBQueryBestSizeReply(XCBConnection *c, XCBQueryBestSizeCookie cookie, XCBGenericError **e);
>  XCBQueryExtensionCookie XCBQueryExtension(XCBConnection *c, CARD16 name_len, const char *name);
>  XCBQueryExtensionRep *XCBQueryExtensionReply(XCBConnection *c, XCBQueryExtensionCookie cookie, XCBGenericError **e);
> 
> --=-HAUXeYqrHrte4P33S2aI
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
> 
> _______________________________________________
> xcb mailing list
> xcb at freedesktop.org
> http://freedesktop.org/mailman/listinfo/xcb
> 
> --=-HAUXeYqrHrte4P33S2aI--
> 
> 



More information about the xcb mailing list