[PATCH] headers: Fix build errors with latest glibc

Alexander E. Patrakov patrakov at gmail.com
Tue Jul 15 03:18:20 PDT 2014

14.07.2014 19:41, Daniel Stone wrote:
> os.h isn't safe to necessarily safe to include without xorg-server.h, as
> it drags in misc.h, which has: extern _X_EXPORT void SwapLongs(CARD32
> *list, unsigned long count);
> Again, CARD32 is unsigned long without xorg-server.h, which makes it
> 64-bit on those systems; including xorg-server.h defines _XSERVER64,
> which makes CARD32 actually be uint32_t. Not massively harmful, but
> still not really great. A lot of the authorization functions also use
> XID types, which have the same variance on 64-bit systems without
> xorg-server.h.
> It might not be strictly harmful in some cases, but it's not the sort of
> thing I want to encourage. 'Always include xorg-server.h before any X
> header ever' is a really simple rule to remember for driver developers;
> muddying the water, particularly when not documented, isn't amazingly
> helpful IMHO.

If so, might it be a good idea to start enforcing this at some later 
point in time - i.e. #error out in other headers if _XORG_SERVER_H_ is 
not defined?

Alexander E. Patrakov

More information about the xorg-devel mailing list