From: Amos Jeffries Date: Thu, 3 Mar 2011 15:41:54 +0000 (+1300) Subject: Bug 2885: Compile errors on AIX X-Git-Tag: take06~27^2~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=349a322fd3777ad4fbd1192c46e920de60e26ea6;p=thirdparty%2Fsquid.git Bug 2885: Compile errors on AIX Support AIX unusual definition of in_addr/in6_addr unions. --- diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 5030fb6c4b..2797be8ae2 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -212,6 +212,14 @@ Ip::Address::SetEmpty() memset(&m_SocketAddr, 0, sizeof(m_SocketAddr) ); } +#if _SQUID_AIX_ + // Bug 2885 comment 78 explains. + // In short AIX has a different netinet/in.h union definition +const struct in6_addr Ip::Address::v4_localhost = {{{ 0x00000000, 0x00000000, 0x0000ffff, 0x7f000001 }}}; +const struct in6_addr Ip::Address::v4_anyaddr = {{{ 0x00000000, 0x00000000, 0x0000ffff, 0x00000000 }}}; +const struct in6_addr Ip::Address::v4_noaddr = {{{ 0x00000000, 0x00000000, 0x0000ffff, 0xffffffff }}}; +const struct in6_addr Ip::Address::v6_noaddr = {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }}}; +#else const struct in6_addr Ip::Address::v4_localhost = {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }} }; @@ -224,7 +232,7 @@ const struct in6_addr Ip::Address::v4_noaddr = {{{ 0x00, 0x00, 0x00, 0x00, 0x00, const struct in6_addr Ip::Address::v6_noaddr = {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }} }; - +#endif bool Ip::Address::SetIPv4()