[PATCH app/xdpyinfo] Include Xwindows.h on WIN32 to avoid type clashes

Jon TURNEY jon.turney at dronecode.org.uk
Tue Oct 30 06:03:16 PDT 2012


On 29/10/2012 13:57, walter harms wrote:
> 
> 
> Am 29.10.2012 14:38, schrieb Jon TURNEY:
>> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
>> ---
>>  xdpyinfo.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/xdpyinfo.c b/xdpyinfo.c
>> index dcca0ad..2482156 100644
>> --- a/xdpyinfo.c
>> +++ b/xdpyinfo.c
>> @@ -78,6 +78,10 @@ in this Software without prior written authorization from The Open Group.
>>  
>>  #endif
>>  
>> +#ifdef WIN32
>> +#include <X11/Xwindows.h>
>> +#endif
>> +
> 
> would it hurt to include that with other architecture also ?
> 
> re,
>  wh

I'm not sure I understand the question.

X11/Xwindows.h is a wrapper for windows.h, the Windows-specific header file
which declares the Windows API, which avoids conflicts between that header and
X headers.

It doesn't make much sense to try to include it on other platforms.

In this specific case, including XWindows.h first avoids conflicting type
definitions between windows.h (which is otherwise included unwrapped by xcb.h)
and Xproto.h

>   CC     xdpyinfo.o
> In file included from /jhbuild/install-mingw/include/X11/Xproto.h:72:0,
>                  from /jhbuild/checkout/xorg/app/xdpyinfo/xdpyinfo.c:89:
> /jhbuild/install-mingw/include/X11/Xmd.h:122:14: error: conflicting types for ‘INT32’
> /usr/i686-pc-mingw32/sys-root/mingw/include/basetsd.h:54:13: note: previous declaration of ‘INT32’ was here
> /jhbuild/install-mingw/include/X11/Xmd.h:145:15: error: conflicting types for ‘BOOL’
> /usr/i686-pc-mingw32/sys-root/mingw/include/windef.h:234:17: note: previous declaration of ‘BOOL’ was here



More information about the xorg-devel mailing list