mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
OSX compile IPAddress fixes
This commit is contained in:
parent
d56a7a1ee6
commit
348ca08e7a
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user