[Mesa-dev] [PATCH] Fix _GNUC__ typo in check for gcc 3.x for _mesa_bitcount

Alan Coopersmith alan.coopersmith at oracle.com
Fri Oct 21 15:19:15 PDT 2011


On 10/20/11 18:30, Jason Wood wrote:
> On 10/20/2011 06:58 PM, Alan Coopersmith wrote:
>> Without this fix, builds with gcc 3.4.x end up depending on undefined
>> _mesa_bitcount instead of gcc's __builtin_popcount.
>>
>> NOTE: This is a candidate for the stable branches.
>>
>> Signed-off-by: Alan Coopersmith<alan.coopersmith at oracle.com>
>> ---
>> src/mesa/main/imports.c | 2 +-
>> src/mesa/main/imports.h | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
>> index 345a1c5..1c44727 100644
>> --- a/src/mesa/main/imports.c
>> +++ b/src/mesa/main/imports.c
>> @@ -514,7 +514,7 @@ _mesa_ffsll(int64_t val)
>> #endif
>>
>> #if !defined(__GNUC__) ||\
>> - ((_GNUC__ == 3&& __GNUC_MINOR__< 4)&& __GNUC__< 4)
>> + ((__GNUC__ == 3&& __GNUC_MINOR__< 4)&& __GNUC__< 4)
>
> I realize this patch is a typo fix, but isn't this logically equivalent to:
>
> (__GNUC__ == 3&& __GNUC_MINOR__< 4)
>
>
> maybe what you are really after is:
>
> (__GNUC__ == 3&& __GNUC_MINOR__< 4) || __GNUC__< 3

Yes, I'd noticed that too, and think it would break gcc 2.x if that's still
supported at all (please tell me no one expects gcc 1.x to still work), but
I wasn't sure if even 2.x was still expected to work and all the options I
thought of were much messier than that, so I'd left it for another time/person.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the mesa-dev mailing list