diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-08-02 20:41:55 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-08-02 21:03:09 (GMT) |
commit | d5ace22054203c7989691ae8b3fa4e4784d1b57e (patch) | |
tree | 64d400cdb10644967df183d0f202fcbf8160a773 /3rdParty/Boost/src/boost/asio/ip/detail/impl | |
parent | 6f26d9aa86f0909af13b23b1a925b8d492e74154 (diff) | |
download | swift-contrib-ks/boost1.47.zip swift-contrib-ks/boost1.47.tar.bz2 |
Add two extra Boost dependencies, upgrade to 1.47.0ks/boost1.47
Diffstat (limited to '3rdParty/Boost/src/boost/asio/ip/detail/impl')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp index 0443d38..e70c645 100644 --- a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp +++ b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp @@ -57,8 +57,14 @@ endpoint::endpoint(int family, unsigned short port_num) data_.v6.sin6_port = boost::asio::detail::socket_ops::host_to_network_short(port_num); data_.v6.sin6_flowinfo = 0; - boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT; - data_.v6.sin6_addr = tmp_addr; + data_.v6.sin6_addr.s6_addr[0] = 0; data_.v6.sin6_addr.s6_addr[1] = 0; + data_.v6.sin6_addr.s6_addr[2] = 0, data_.v6.sin6_addr.s6_addr[3] = 0; + data_.v6.sin6_addr.s6_addr[4] = 0, data_.v6.sin6_addr.s6_addr[5] = 0; + data_.v6.sin6_addr.s6_addr[6] = 0, data_.v6.sin6_addr.s6_addr[7] = 0; + data_.v6.sin6_addr.s6_addr[8] = 0, data_.v6.sin6_addr.s6_addr[9] = 0; + data_.v6.sin6_addr.s6_addr[10] = 0, data_.v6.sin6_addr.s6_addr[11] = 0; + data_.v6.sin6_addr.s6_addr[12] = 0, data_.v6.sin6_addr.s6_addr[13] = 0; + data_.v6.sin6_addr.s6_addr[14] = 0, data_.v6.sin6_addr.s6_addr[15] = 0; data_.v6.sin6_scope_id = 0; } } @@ -85,14 +91,14 @@ endpoint::endpoint(const boost::asio::ip::address& addr, data_.v6.sin6_flowinfo = 0; boost::asio::ip::address_v6 v6_addr = addr.to_v6(); boost::asio::ip::address_v6::bytes_type bytes = v6_addr.to_bytes(); - memcpy(data_.v6.sin6_addr.s6_addr, bytes.elems, 16); + memcpy(data_.v6.sin6_addr.s6_addr, bytes.data(), 16); data_.v6.sin6_scope_id = v6_addr.scope_id(); } } -void endpoint::resize(std::size_t size) +void endpoint::resize(std::size_t new_size) { - if (size > sizeof(boost::asio::detail::sockaddr_storage_type)) + if (new_size > sizeof(boost::asio::detail::sockaddr_storage_type)) { boost::system::error_code ec(boost::asio::error::invalid_argument); boost::asio::detail::throw_error(ec); @@ -139,7 +145,11 @@ boost::asio::ip::address endpoint::address() const else { boost::asio::ip::address_v6::bytes_type bytes; +#if defined(BOOST_ASIO_HAS_STD_ARRAY) + memcpy(bytes.data(), data_.v6.sin6_addr.s6_addr, 16); +#else // defined(BOOST_ASIO_HAS_STD_ARRAY) memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16); +#endif // defined(BOOST_ASIO_HAS_STD_ARRAY) return boost::asio::ip::address_v6(bytes, data_.v6.sin6_scope_id); } } |