[Pixman] [PATCH] Fix pixman build with older GCC releases

Siarhei Siamashka siarhei.siamashka at gmail.com
Sat Aug 10 02:39:16 PDT 2013


On Sat, 10 Aug 2013 04:33:39 -0400
Brad Smith <brad at comstyle.com> wrote:

> ----- Original message -----
> > On Fri, Aug 9, 2013 at 6:47 PM, Brad Smith <brad at comstyle.com> wrote:
> > > The following diff fixes building pixman with older GCC releases such
> > > as GCC 3.3.
> > > 
> > > 
> > > diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c
> > > index 89b9682..cacc05c 100644
> > > --- a/pixman/pixman-matrix.c
> > > +++ b/pixman/pixman-matrix.c
> > > @@ -37,7 +37,8 @@
> > > static force_inline int
> > > count_leading_zeros (uint32_t x)
> > > {
> > > -#ifdef __GNUC__
> > > +#if defined(__GNUC__) && \
> > > +             (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
> > > return __builtin_clz (x);
> > > #else
> > > int n = 0;
> > > 
> > > --
> > 
> > No objections, but I'm just curious: why?
> 
> You actually have to ask why someone would want pixman to build?

I guess it's more like a question about why you are mixing an up to
date version of pixman with roughly a decade old compiler. You probably
have some good reasons for this, but it's not really surprising that
people are getting curious.

About the fix itself. It may be a bit cleaner to implement a configure
check for __builtin_clz. Pixman can be compiled by various compilers.
Checking for a particular version of GCC may potentially become a bit
messy when we are dealing with GCC-compatible compilers (Clang, ICC,
Solaris Studio, ...) instead of the original GCC.

-- 
Best regards,
Siarhei Siamashka


More information about the Pixman mailing list