OSX compile IPAddress fixes

This commit is contained in:
Aleksandar Fabijanic 2012-07-26 03:23:16 +00:00
parent d56a7a1ee6
commit 348ca08e7a
2 changed files with 36 additions and 27 deletions

View File

@ -96,4 +96,20 @@ void Net_API uninitializeNetwork();
} } // namespace Poco::Net
#if !defined(s6_addr16)
#if defined(POCO_OS_FAMILY_WINDOWS)
#define s6_addr16 u.Word
#else
#define s6_addr16 __u6_addr.__u6_addr16
#endif
#endif
#if !defined(s6_addr32)
#if defined(POCO_OS_FAMILY_UNIX)
#define s6_addr32 __u6_addr.__u6_addr32
#endif
#endif
#endif // Net_Net_INCLUDED

View File

@ -348,13 +348,6 @@ public:
std::memcpy(&_addr, addr, sizeof(_addr));
}
#if !defined(s6_addr16)
#if defined(_WIN32)
#define s6_addr16 u.Word
#else
#define s6_addr16 __u6_addr.__u6_addr16
#endif
#endif
IPv6AddressImpl(unsigned prefix):
_scope(0)
@ -1058,16 +1051,16 @@ IPAddress IPAddress::operator & (const IPAddress& other) const
{
if (family() == IPv4)
{
IPv4AddressImpl self(_pImpl->addr());
IPv4AddressImpl other(other._pImpl->addr());
return IPAddress((self & other).addr(), sizeof(struct in_addr));
IPv4AddressImpl t(_pImpl->addr());
IPv4AddressImpl o(other._pImpl->addr());
return IPAddress((t & o).addr(), sizeof(struct in_addr));
}
#if defined(POCO_HAVE_IPv6)
else if (family() == IPv6)
{
IPv6AddressImpl self(_pImpl->addr());
IPv6AddressImpl other(other._pImpl->addr());
return IPAddress((self & other).addr(), sizeof(struct in6_addr));
IPv6AddressImpl t(_pImpl->addr());
IPv6AddressImpl o(other._pImpl->addr());
return IPAddress((t & o).addr(), sizeof(struct in6_addr));
}
#endif
else
@ -1084,16 +1077,16 @@ IPAddress IPAddress::operator | (const IPAddress& other) const
{
if (family() == IPv4)
{
IPv4AddressImpl self(_pImpl->addr());
IPv4AddressImpl other(other._pImpl->addr());
return IPAddress((self | other).addr(), sizeof(struct in_addr));
IPv4AddressImpl t(_pImpl->addr());
IPv4AddressImpl o(other._pImpl->addr());
return IPAddress((t | o).addr(), sizeof(struct in_addr));
}
#if defined(POCO_HAVE_IPv6)
else if (family() == IPv6)
{
IPv6AddressImpl self(_pImpl->addr());
IPv6AddressImpl other(other._pImpl->addr());
return IPAddress((self | other).addr(), sizeof(struct in6_addr));
IPv6AddressImpl t(_pImpl->addr());
IPv6AddressImpl o(other._pImpl->addr());
return IPAddress((t | o).addr(), sizeof(struct in6_addr));
}
#endif
else
@ -1110,16 +1103,16 @@ IPAddress IPAddress::operator ^ (const IPAddress& other) const
{
if (family() == IPv4)
{
IPv4AddressImpl self(_pImpl->addr());
IPv4AddressImpl other(other._pImpl->addr());
return IPAddress((self ^ other).addr(), sizeof(struct in_addr));
IPv4AddressImpl t(_pImpl->addr());
IPv4AddressImpl o(other._pImpl->addr());
return IPAddress((t ^ o).addr(), sizeof(struct in_addr));
}
#if defined(POCO_HAVE_IPv6)
else if (family() == IPv6)
{
IPv6AddressImpl self(_pImpl->addr());
IPv6AddressImpl other(other._pImpl->addr());
return IPAddress((self ^ other).addr(), sizeof(struct in6_addr));
IPv6AddressImpl t(_pImpl->addr());
IPv6AddressImpl o(other._pImpl->addr());
return IPAddress((t ^ o).addr(), sizeof(struct in6_addr));
}
#endif
else
@ -1134,13 +1127,13 @@ IPAddress IPAddress::operator ~ () const
{
if (family() == IPv4)
{
IPv4AddressImpl self(_pImpl->addr());
IPv4AddressImpl self(this->_pImpl->addr());
return IPAddress((~self).addr(), sizeof(struct in_addr));
}
#if defined(POCO_HAVE_IPv6)
else if (family() == IPv6)
{
IPv6AddressImpl self(_pImpl->addr());
IPv6AddressImpl self(this->_pImpl->addr());
return IPAddress((~self).addr(), sizeof(struct in6_addr));
}
#endif