Subject: A patch to fix building on 64-bit powerpc

A patch to fix building on 64-bit powerpc

From: 關振德 <dougkwan_at_google.com>
Date: Fri, 14 Feb 2014 22:32:55 -0800

Hi,

    I would like to submit a patch to fix building of ares on a ppc64
system with certain compilers. The code in ares_build.h.dist tries to
figure out correct value for CARES_SIZEOF_LONG for gcc. It does so by
check __ppc__ first and then __ppc64__. There are two issues.

1. gcc actually does not use __ppc__ and __ppc64__ but __PPC__ and
__PPC64__.
    The tests of __ILP32__ and __LP64__ are sufficient for gcc.
2. clang defines __GNU__ and defines both __ppc64__ and __ppc__ when
targeting ppc64. This makes CARES_SIZEOF_LONG to be 4 on a ppc64 system
when building with clang.

My patch is two change the order of the checks so that we check the 64-bit
case first.
Could someone consider that patch and incorporate that into ares?

-Doug

Received on 2014-02-16