[Xcb] XSync extension broken in many ways..

Thomas Hunger hto at arcor.de
Mon Sep 3 04:35:10 PDT 2007

> In the old Xlib code, they got around this issue by using
> #if ((defined(__STDC__) || defined(__cplusplus) ||
> defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
> #define _SIZEOF(x) sz_##x
> #define SIZEOF(x) _SIZEOF(x)
> #else
> #define SIZEOF(x) sz_/**/x
> #endif /* if ANSI C compiler else not */

I am still fighting with XKB. When that is done I'd like include my 
new python generator into XCB (as an option in ./configure) [1].

The new generator counts the expected size of structs and could 
generate the alternative sizeof using a #define.

But why not use the defines unconditionally? The generator could emit:

    #define SZ_SOMESTRUCT size

and use that everywhere instead of



[1] Everything seems to work fine & I have a few tests. Cairo needs a
    patch though, because matrix11, matrix21, ... got changed to
    matrix_11, matrix_21, ...

More information about the Xcb mailing list