OK, Alan - that looks like a better fix than my patch. When this goes in, we
can remove the XFree86Server checks from gl.h and glext.h.
Alan Hourihane wrote:
> On Mon, Dec 08, 2003 at 02:45:30PM +0000, Keith Whitwell wrote:
>>Failing to compile dispatch.c in programs/Xserver/GL/mesa/main...
>>This one looks like it is caused by the recent change to gl.h to include
>><stddef.h> in order to provide a definition for ptrdiff_t.
>>Unfortunatly, in whacky-xfree86-world, including headers like that will
>>lead to trouble, and what's required is to include "xf86_libc.h" or nothing
>>at all. I've included a patch for this...
>>But... unfortunately this means that we don't get the ptrdiff_t
>>definition... So, that means that somewhere in maybe
>> os-support/xf86_libc.h? we need something like:
>># define ptrdiff_t int
>>The other option would be to change gl.h and glext.h to use int or GLint
>>instead of ptrdiff_t...
> Actually, I came up with this that I didn't commit (as I forgot about it)..
> I've sent an email to David to double check this is o.k. unless he has
> another approach.
> Index: programs/Xserver/hw/xfree86/os-support/xf86_libc.h
> RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v
> retrieving revision 1.16
> diff -u -r1.16 xf86_libc.h
> --- programs/Xserver/hw/xfree86/os-support/xf86_libc.h 12 Sep 2003 19:39:06 -0000 1.16
> +++ programs/Xserver/hw/xfree86/os-support/xf86_libc.h 8 Dec 2003 14:58:42 -0000
> @@ -80,7 +80,11 @@
> typedef struct _xf86dirent XF86DIRENT;
> +#if !(defined (__GNUG__) && defined (size_t))
> +typedef unsigned int xf86size_t;
> typedef unsigned long xf86size_t;
> typedef signed long xf86ssize_t;
> typedef unsigned long xf86dev_t;
> typedef unsigned int xf86mode_t;