[Mesa-dev] [PATCH 4/4] Fix build with gcc 3.3.

Owain Ainsworth zerooa at googlemail.com
Sun Apr 18 23:38:27 PDT 2010


On Mon, Apr 19, 2010 at 07:34:04AM +0200, Matthieu Herrb wrote:
> On Sun, Apr 18, 2010 at 05:03:51PM -0700, Jeremy Huddleston wrote:
> > This one looks broken...
> > 
> > > #if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC__ >= 4) || __GNUC__ >= 4)
> > 
> > 
> > (__GNUC__ == 3 && __GNUC__ >= 4)
> > 
> > you forgot _MINOR...
> > 
> > And I think your '__GNUC_MINOR__ >= 3' might need to be >= 4
> > 
> 
> Yes, sorry. My first thought was that those builting were gcc 4 only
> and I wrote and tested patches with only the __GNUC__ >= 4 test.
> Then I found out that gcc 3.4 also have them and quickly modified my tests.
> I managed to make one mistake per chunk !.
> 
> the commit below to my tree fixes them.

I can respin this series (with this squashed into patch 4), or we can
just tack this on onto the end of it. Whatever is preferred.

-0-

> From 364fa55571ac869e71ec48145da6a81e134323f8 Mon Sep 17 00:00:00 2001
> From: Matthieu Herrb <matthieu.herrb at laas.fr>
> Date: Mon, 19 Apr 2010 07:19:41 +0200
> Subject: [PATCH 5/5] Fix numerous typoes in previous commits.
> 
> Thou shall not commit untested last minute changes.
> ---
>  src/mesa/main/imports.c |    2 +-
>  src/mesa/main/imports.h |    6 ++++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
> index 65fd476..b1389b2 100644
> --- a/src/mesa/main/imports.c
> +++ b/src/mesa/main/imports.c
> @@ -565,7 +565,7 @@ unsigned int
>  _mesa_bitcount(unsigned int n)
>  {
>  #if defined(__GNUC__) && \
> -	((_GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ >= 4))
> +	((_GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
>     return __builtin_popcount(n);
>  #else
>     unsigned int bits;
> diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
> index 48ffb2b..1c263aa 100644
> --- a/src/mesa/main/imports.h
> +++ b/src/mesa/main/imports.h
> @@ -404,7 +404,8 @@ _mesa_is_pow_two(int x)
>  static INLINE int32_t
>  _mesa_next_pow_two_32(uint32_t x)
>  {
> -#if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC__ >= 4) || __GNUC__ >= 4)
> +#if defined(__GNUC__) && \
> +	((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
>  	uint32_t y = (x != 1);
>  	return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
>  #else
> @@ -422,7 +423,8 @@ _mesa_next_pow_two_32(uint32_t x)
>  static INLINE int64_t
>  _mesa_next_pow_two_64(uint64_t x)
>  {
> -#if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC__ >= 4) || __GNUC__ >= 4)
> +#if defined(__GNUC__) && \
> +	((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
>  	uint64_t y = (x != 1);
>  	if (sizeof(x) == sizeof(long))
>  		return (1 + y) << ((__builtin_clzl(x - y) ^ 63));
> -- 
> 1.6.5.7
> 
> 
> -- 
> Matthieu Herrb

-- 
"I'd love to go out with you, but I'm doing door-to-door collecting for
static cling."


More information about the mesa-dev mailing list