[PATCH] headers: Fix build errors with latest glibc
Daniel Stone
daniel at fooishbar.org
Wed Jul 2 15:07:42 PDT 2014
Hi,
On 2 July 2014 20:14, Hans de Goede <hdegoede at redhat.com> wrote:
> include/os.h defines protyptes for various non ansi-c str functions, such
> as str[n]casecmp and strndup. The definition of the prototypes is guarded
> by #ifndef HAVE_STRFOO, but HAVE_STRFOO is defined by xorg-server.h which
> is not included by all users of os.h. E.g. glamor.h does not and should not
> include xorg-server.h
>
> This is a problem since the these prototype declarations clash with the
> libc
> declarations when using the latest glibc:
>
> In file included from /usr/include/xorg/misc.h:115:0,
> from /usr/include/xorg/screenint.h:50,
> from /usr/include/xorg/scrnintstr.h:50,
> from /usr/include/xorg/glamor.h:32,
> from conftest.c:61:
> /usr/include/xorg/os.h:579:2: error: expected identifier or '(' before
> '__extension__'
> strndup(const char *str, size_t n);
>
> To fix this, this commit moves the HAVE_STRFOO defines to their own
> (generated) header called os-strfeatures.h, and unconditionally includes
> this
> header from os.h .
>
NAK.
If glamor.h includes scrnintstr.h, it must include xorg-server.h.
xorg-server.h (as distinct from xorg-config.h) is the specially-generated
header designed explicitly to be included by all exported/SDK modules which
include internal headers, since it carries defines such as _XSERVER64 (and
many, many more) which thoroughly smash the server ABI.
If glamor.h can't have xorg-server.h, then it can't have any other server
headers either.
Cheers,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140702/167b4425/attachment.html>
More information about the xorg-devel
mailing list