From: Amos Jeffries Date: Sat, 21 Jun 2014 04:19:19 +0000 (-0600) Subject: Windows: fix various libip build issues X-Git-Tag: SQUID_3_4_6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0160596b1c3ca965f653aadf882dc3b9dc02477;p=thirdparty%2Fsquid.git Windows: fix various libip build issues * Missing include ws2tcpip.h for IPv6 definitions * Alternative IN6_ARE_ADDR_EQUAL definition required * 'byte' is a reserved / system defined type on Windows, resolve variable shadowing by renaming to ipbyte. --- diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 3f7a72ea4c..ba3cff5a2c 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -21,6 +21,15 @@ /* for inet_ntoa() */ #include #endif +#if HAVE_WS2TCPIP_H +// Windows IPv6 definitions +#include +#endif + +// some OS (ie WIndows) define IN6_ADDR_EQUAL instead +#if !defined(IN6_ARE_ADDR_EQUAL) && _SQUID_WINDOWS_ +#define IN6_ARE_ADDR_EQUAL IN6_ADDR_EQUAL +#endif /* Debugging only. Dump the address content when a fatal assert is encountered. */ #define IASSERT(a,b) \ @@ -35,7 +44,7 @@ int Ip::Address::cidr() const { - uint8_t shift,byte; + uint8_t shift,ipbyte; uint8_t bit,caught; int len = 0; const uint8_t *ptr= mSocketAddr_.sin6_addr.s6_addr; @@ -52,20 +61,20 @@ Ip::Address::cidr() const } for (; shift