From: Amos Jeffries Date: Mon, 9 Jun 2014 15:04:29 +0000 (-0700) Subject: Windows: fix various libip build issues X-Git-Tag: SQUID_3_5_0_1~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=760da7728cbbd758b3396522d915b33b264bd23d;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 51e8659a4d..773441cac9 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -15,6 +15,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) \ @@ -29,7 +38,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; @@ -46,20 +55,20 @@ Ip::Address::cidr() const } for (; shift