[PATCH xserver] Fix build on Cygwin by ensuring WIN32 check triggers only on MinGW

Adam Jackson ajax at nwnk.net
Mon Feb 22 19:28:26 UTC 2016


On Mon, 2016-02-22 at 16:20 +0000, Jon Turney wrote:
> The type of fd_mask was changed in Cygwin 2.4.0 headers from 'long' to 'unsigned
> long'.  This exposes an existing problem with winauth.c, which includes
> Xwindows.h (which includes windows.h, which defines WIN32), before including
> osdep.h, which causes the now conflicting definition of fd_mask in osdep.h to be
> exposed:
> 
> In file included from ../os/osdep.h:198:18: error: conflicting types for ‘fd_mask’
>  typedef long int fd_mask;
> /usr/include/sys/select.h:46:23: note: previous declaration of ‘fd_mask’ was here
>  typedef unsigned long fd_mask;
> 
> Adjust the include guards in osdep.h to make sure we only use WIN32 guarded code
> when not compiling for Cygwin (i.e. WIN32 && !__CYGWIN__)
> 
> This isn't a very elegant, but unfortunately appears to be the best solution,
> since it doesn't seem to be possible to write the test in a positive form.
> 
> Future work: Should also audit of all the other uses of WIN32 in xserver, and
> make sure they are correct.

remote: I: patch #74619 updated using rev 30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   544b414..30b7d79  master -> master

- ajax


More information about the xorg-devel mailing list