[Xfce4-commits] r29924 - in xfce4-dev-tools/trunk: . m4macros

Brian J. Tarricone bjt23 at cornell.edu
Tue May 5 00:05:52 CEST 2009

Ali Abdallah wrote:
> Brian J. Tarricone wrote:
>> Ali, on a side note... looking at my headers, I see that 
>> XSyncValueAdd() is actually a function call.  There's a 
>> _XSyncValueAdd() macro (note the leading '_') in there that has the 
>> problem you describe.  According to the comment above the macros:
>> /*  The _XSync macros below are for library internal use only.  They 
>> exist
>>  *  so that if we have to make a fix, we can change it in this one place
>>  *  and have both the macro and function variants inherit the fix.
>>  */
>> So it seems you (and xfwm4) shouldn't be using those macros at all?
> I was wrong, what we are using here is XSync functions, but it is just 
> #define XSync _XSync in the sync header, and these functions are used 
> everywhere (xfwm4, gpm, metacity, lot of other wm), i'm quite surprised 
> that i didn't find on the net any complains about it.

Ah, seems like I missed that section, which has this comment:

  *  These are the publically usable macros.  If you want the function 
  *  of one of these, just #undef the macro to uncover the function.
  *  (This is the same convention that the ANSI C library uses.)

So to get rid of the warning, you could just #undef XSyncValueAdd after 
including sync.h.  Of course, the macros might be more performant than 
the function calls, so that might be an issue.  I imagine it probably 
isn't, though...


More information about the Xfce4-dev mailing list