This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ITA] w32api-3.0b_svn5368-1


On 8/21/2012 19:11, Jon TURNEY wrote:
> On 21/08/2012 05:47, JonY wrote:
>> On 8/21/2012 11:46, Christopher Faylor wrote:
>>> On Tue, Aug 21, 2012 at 11:31:23AM +0800, JonY wrote:
>>>> On 8/21/2012 10:23, JonY wrote:
>>>>> On 8/21/2012 09:15, JonY wrote:
>>>>>> On 8/21/2012 07:22, Yaakov (Cygwin/X) wrote:
>>>>>>> On 2012-08-20 07:15, JonY wrote:
>>>>>>> So I built this from SVN trunk myself, and xorg-server still FTBFS:
>>>>>>>
>>>>>>> In file included from /usr/include/w32api/windows.h:69:0,
>>>>>>>                  from /usr/include/X11/Xwindows.h:60,
>>>>>>>                  from ../../../hw/xwin/winms.h:42,
>>>>>>>                  from ../../../hw/xwin/win.h:193,
>>>>>>>                  from winpriv.c:10:
>>>>>>> /usr/include/w32api/windef.h:107:13: error: conflicting types for 'BOOL'
>>>>>>> /usr/include/X11/Xmd.h:143:16: note: previous declaration of 'BOOL' was
>>>>
>>>> Yaakov, try this change:
>>>>
>>>> Index: include/windef.h
>>>> ===================================================================
>>>> --- include/windef.h    (revision 5374)
>>>> +++ include/windef.h    (working copy)
>>>> @@ -101,6 +101,7 @@
>>>> #ifndef _DEF_WINBOOL_
>>>> #define _DEF_WINBOOL_
>>>> typedef int WINBOOL;
>>>> +#ifndef XFree86Server /* For xorg-server */
>>>> #pragma push_macro("BOOL")
>>>> #undef BOOL
>>>> #if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU)
>>>> @@ -110,6 +111,7 @@
>>>> typedef BOOL *PBOOL;
>>>> typedef BOOL *LPBOOL;
>>>> #pragma pop_macro("BOOL")
>>>> +#endif /* XFree86Server */
>>>> #endif /* _DEF_WINBOOL_ */
>>>>
>>>> I'm not sure if things will explode horribly.
>>>
>>> Maybe this is just a sanity check/proof of concept thing but do we
>>> really want to have specific ifdef's like this in shipping headers?
>>> That would suggest a neverending cascade of ifdefs.
>>>
>>> If we really need something like this then I'd suggest something more
>>> generic like a #ifdef __PROTECT_PROTECT_BOOL_MACRO.
>>
>> yeah, it is just a proof of concept, it is copied from the existing
>> w32api package. If this works, I'll talk to Kai about untangling the ifdefs.
> 
> I've never been really sure what historical accidents are behind the #ifdef
> XFree86Server in w32api.  It doesn't do anything useful, since in the X
> server, windows header files are always included via a header which wraps them
> to avoid name collisions [1], which carefully arranges for XFree86Server to be
> undefined.
> 
> [1] http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xwindows.h
> 
> 

Here's the part from mingw-w64 windef.h:

#ifndef _DEF_WINBOOL_
#define _DEF_WINBOOL_
typedef int WINBOOL;
#pragma push_macro("BOOL")
#undef BOOL
#if !defined(__OBJC__) && !defined(__OBJC_BOOL) &&
!defined(__objc_INCLUDE_GNU)
typedef int BOOL;
#endif
#define BOOL WINBOOL
typedef BOOL *PBOOL;
typedef BOOL *LPBOOL;
#pragma pop_macro("BOOL")
#endif /* _DEF_WINBOOL_ */

Note the pragma push and undef, the Xwindows.h macro tricks no longer
works. Perhaps guarding against _XFree86Server instead of XFree86Server
will work?


Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]