[Xcb] XSync extension broken in many ways..

Rob Taylor rob.taylor at codethink.co.uk
Mon Sep 3 04:48:30 PDT 2007


Thomas Hunger wrote:
>> 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.

I think this should also be plausible in pure xslt, but my xslt skills
aren't strong enough to do it. I'll be happy with any solution :)

> But why not use the defines unconditionally? The generator could emit:
> 
>     #define SZ_SOMESTRUCT size
> 
> and use that everywhere instead of
> 
>     sizeof(somestruct)


That's exactly what I'm suggesting! The above is only conditional on
whether the preprocessor supports token pasting.

Thanks,
Rob

> tom
> 
> [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, ...
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb


-- 
Rob Taylor, Codethink Ltd. -  http://codethink.co.uk


More information about the Xcb mailing list