Subject: xsrc/11788: /usr/X11R6/include/X11/Xlib.h conflicts with files in /usr/include
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gr@eclipsed.net>
List: netbsd-bugs
Date: 12/20/2000 02:54:12
>Number:         11788
>Category:       xsrc
>Synopsis:       /usr/X11R6/include/X11/Xlib.h conflicts with files in /usr/include
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 02:54:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     gabriel rosenkoetter
>Release:        Around September, 2000 (immediately previous i386 snapshot)
>Organization:
	
>Environment:
	
System: NetBSD ambriel.eclipsed.net 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (AMBRIEL) #0: Mon Sep 25 10:39:32 EDT 2000 gr@ambriel:/usr/src/sys/arch/i386/compile/AMBRIEL i386


>Description:
Trying to compile xloadimage-4.1 (because I like its xsetbg better
than using xv -quit -root... but I got used to using it on a Sun
system which is still running an X11R5 Xsun, so maybe it's time to
give up) tickled what seems to be a disagreement between
/usr/X11R6/include/X11/Xlib.h and /usr/include/stdlib.h (and
<wchar.h> and <curses.h> too, probably... not that seeing curses
included in an X app makes much sense, but whatever).

I'm not *positive* this is something that needs changing, but it
sure looks like the right thing to do, based on what Xlib.h itself
says on line 85 (comment in the midst of the below):

#ifndef X_WCHAR
#include <stddef.h>
#else
#ifdef __EMX__
#include <stdlib.h>
#else
#ifdef DGUX
/* DG/ux needs this always! */
#include <stddef.h>
#else
#ifdef __NetBSD__
#include <wchar.h>
#else
/* replace this with #include or typedef appropriate for your system */
typedef unsigned long wchar_t;
#endif
#endif
#endif
#endif

Sounds to me like we ought to be doing an:

#ifdef __NetBSD__
#include <wchar.h>
[...]
#endif

... which is exactly what the attached patch does.

Considering I don't know too much about the innards of XFree86,
though, I could well be wrong. My includes/libraries could also well
be out of date. Please, set me straight if either of these is the
case.

>How-To-Repeat:
Well, you could try building xloadimage-4.1, but considering it
comes out of ftp.x.org/R5contrib, expecting it to work is a bit
shady.

An inspection of /usr/X11R6/include/X11/Xlib.h and
/usr/include/wchar.h justifies my point a little more sensibly.
>Fix:
Patch for Xlib.h:

--- /usr/X11R6/include/X11/Xlib.h	Wed Dec 20 04:52:50 2000
+++ /usr/X11R6/include/X11/Xlib.h.orig	Tue Aug  8 03:00:03 2000
@@ -79,12 +79,8 @@
 /* DG/ux needs this always! */
 #include <stddef.h>
 #else
-#ifdef __NetBSD__
-#include <wchar.h>
-#else
 /* replace this with #include or typedef appropriate for your system */
 typedef unsigned long wchar_t;
-#endif
 #endif
 #endif
 #endif
>Release-Note:
>Audit-Trail:
>Unformatted: