[Xcb] [patch] XCB headers are unusable.
Zephaniah E. Hull
warp at aehallh.com
Wed Aug 23 09:58:07 PDT 2006
On Fri, Aug 18, 2006 at 08:44:33PM -0700, Josh Triplett wrote:
> Zephaniah E. Hull wrote:
> > While attempting to get XCB working for a new extension, I came across a
> > tiny problem.
> >
> > XCB's headers all include "xcb.h", and in some cases go further to
> > include other xcb header files in the same fashion.
> >
> > The .pc files all say to add -I/usr/include, not /usr/include/X11/XCB,
> > so without further dancing it is impossible to include any of them.
>
> This should actually work fine; you can include the headers quite easily
> either from within XCB or from an arbitrary program. User programs must
> include the headers by saying #include <X11/XCB/xcb.h>, just as users of
> Xlib say #include <X11/Xlib.h>. Because the XCB headers themselves
> include other XCB headers by saying #include "xcb.h", using doublequotes
> rather than angle brackets, the compiler will find the other headers
> alongside the one doing the including. Some examples:
Ah, I had been doing initial testing with tools that didn't honor that
bit in search paths.
However I'll note that Xlib is no longer such a good example, almost all
of X's exported headers do the '#include <X11/foo.h>' since 6.9/7.0.
It would probably be a good idea to make the change anyhow, just to be
consistant with the rest of X, though that doesn't look quite as
pressing as long as I can do without cproto. :)
<snip, as I now grok the problem>
> A few more comments about your patch below.
>
> > --- a/xcb/src/Makefile.am
> > +++ b/xcb/src/Makefile.am
[...]
> > @@ -66,16 +69,16 @@ EXTSOURCES = \
> > EXTENSIONS = $(EXTSOURCES) $(EXTHEADERS)
> >
> > ESSENTIAL_EXTENSIONS = \
> > - extensions/bigreq.h \
> > + $(XCB_HDIR)/bigreq.h \
> > extensions/bigreq.c \
> > - extensions/xc_misc.h \
> > + $(XCB_HDIR)/xc_misc.h \
> > extensions/xc_misc.c
>
> If we move the generated headers out of extensions/, we might as well
> move the generated sources out of there too, and stop using the directory.
Where would be a good place to move them to?
>
> > @@ -189,6 +192,14 @@ vpath %.xml $(XCBPROTO_XCBINCLUDEDIR) $(
> > $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
> > -o $@ $(srcdir)/c-client.xsl $<
> >
> > +$(XCB_HDIR)/%.h: %.xml c-client.xsl
> > + @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n)
> > + $(XSLTPROC) --stringparam mode header \
> > + --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \
> > + --stringparam extension-path \
> > + $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
> > + -o $@ $(srcdir)/c-client.xsl $<
> > +
>
> Why did you add this rule to generate headers in the $(XCB_HDIR)
> directory, but not remove the previous rule to generate headers in the
> extensions/ directory?
Mostly because I was getting fairly tired at the time I made that change
to Makefile.am. :)
If you'd like me to fix up the opcode define patch and this one, I'll
happily do so, test it, and get it to you.
Regards.
Zephaniah E. Hull.
--
1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
CCs of replies from mailing lists are requested.
>> kinds of numbers the tobacco industry wishes it had, and Dell is very
>> very happy with the results.
>
>Do they come with a Surgeon General warning on the box?
The new ones have "Designed for Windows XP". Yes.
-- Satya, Paul Martin, and Derek Balling in the Scary Devil Monastery.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060823/1ef16f8a/attachment.pgp
More information about the Xcb
mailing list