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

Alan Coopersmith alan.coopersmith at oracle.com
Thu Mar 27 14:22:09 PDT 2014


On 03/27/14 02:16 PM, 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?
>
> 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 this is only in code built as part of the XCB libraries, then you'd just use
"inline" and maybe add AC_C_INLINE to the configure.ac.

In headers exported for other software to include though, we've not yet mandated
that all X clients use C99, which is why Xfuncproto.h has all those #ifdefs. 
Though since xcb is so new, it might be able to get away with just using inline
and if any clients can't handle it, they can always add
	#define inline /* not yet */
before including the xcb headers.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the Xcb mailing list