ares_build.h: fix building on 64-bit powerpc

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.
This commit is contained in:
Doug Kwan 2014-02-16 22:54:45 +01:00 committed by Daniel Stenberg
parent d5d3871335
commit bc529dd0c2
1 changed files with 4 additions and 4 deletions

View File

@ -216,12 +216,12 @@
/* ===================================== */
#elif defined(__GNUC__)
# if defined(__ILP32__) || \
defined(__i386__) || defined(__ppc__) || defined(__arm__)
# define CARES_SIZEOF_LONG 4
# elif defined(__LP64__) || \
# if defined(__LP64__) || \
defined(__x86_64__) || defined(__ppc64__)
# define CARES_SIZEOF_LONG 8
# elif defined(__ILP32__) || \
defined(__i386__) || defined(__ppc__) || defined(__arm__)
# define CARES_SIZEOF_LONG 4
# endif
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
# define CARES_SIZEOF_ARES_SOCKLEN_T 4