]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2885: Compile errors on AIX
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 3 Mar 2011 15:41:54 +0000 (04:41 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 3 Mar 2011 15:41:54 +0000 (04:41 +1300)
Support AIX unusual definition of in_addr/in6_addr unions.

src/ip/Address.cc

index 5030fb6c4bb3b497a43a3ef2b2e9cd0ce87c4c39..2797be8ae26952233a33afdd382689d8097b3e71 100644 (file)
@@ -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()