[Xcb] [PATCH RESEND image 11/12] test: use AM_CPPFLAGS rather than per-target test_swap_CPPFLAGS aand others

Josh Triplett josh at joshtriplett.org
Thu Mar 27 17:45:43 PDT 2014


On Thu, Mar 27, 2014 at 05:16:23PM -0400, Gaetan Nadon wrote:
> On 14-03-27 03:22 PM, Josh Triplett wrote:
> > "one target in this directory" does not seem accurate in this case.
> Indeed. Multiple targets, but only one source per target with same C
> Flags unless... point below:
> >
> > Also, test_formats_CPPFLAGS had $(XPROTO_CFLAGS), which got lost in the
> > move to AM_CPPFLAGS.
> Nice catch. Other util repos used to depend on X11 protocol in the past.
> They had removed this dependency from configure.ac but had left this
> undefined variable in the Makefiles. I got in the habit of removing it
> (and this time without realizing it).
> 
> However, I noticed that the test subdir does not #include any X11
> protocol. Should it remain removed?

First of all, if it can be removed, great; however, you should document
that clearly in the commit message, and perhaps do it as a separate
commit for clarity.

> The image subdir does #include <X11/Xfuncproto.h>., but only for
> _X_INLINE. I thought XCB would be independent of X protocols.
> If I replace the includes with the following code from  Xfuncproto.h in
> xcb_bitops.h, then the compilation is successful:
> 
>     /* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
>     /* requires xproto >= 7.0.9
>        (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
>     #if defined(inline) /* assume autoconf set it correctly */ || \
>        (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L))
>     /* C99 */ || \
>        (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
>     # define _X_INLINE inline
>     #elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc
>     w/C89+extensions */
>     # define _X_INLINE __inline__
>     #else
>     # define _X_INLINE
>     #endif
> 
> It'd be nice to completely remove X11 proto from the picture.
> It's a nice trade-off between unwanted dependencies and code reuse...
> We now require C99 for all of xorg. Hmmmm...

If we can simply count on "inline", that seems ideal; if we can't for
some reason, then I'd suggest making a very simple autoconf test that
checks if "inline" works and defines inline to nothing otherwise.

- Josh Triplett


More information about the Xcb mailing list