fix build with std::tr1::array instead of boost::array

This commit is contained in:
Arvid Norberg 2011-08-07 23:40:39 +00:00
parent 587de62205
commit bf2e4df2b2
3 changed files with 8 additions and 8 deletions

View File

@ -195,8 +195,8 @@ namespace libtorrent
// both are v4
address_v4::bytes_type b1 = a1.to_v4().to_bytes();
address_v4::bytes_type b2 = a2.to_v4().to_bytes();
return address_v4::bytes_type::static_size * 8
- common_bits(b1.c_array(), b2.c_array(), b1.size());
return address_v4::bytes_type().size() * 8
- common_bits(b1.data(), b2.data(), b1.size());
#if TORRENT_USE_IPV6
}
@ -206,8 +206,8 @@ namespace libtorrent
else b1 = a1.to_v6().to_bytes();
if (a2.is_v4()) b2 = address_v6::v4_mapped(a2.to_v4()).to_bytes();
else b2 = a2.to_v6().to_bytes();
return address_v6::bytes_type::static_size * 8
- common_bits(b1.c_array(), b2.c_array(), b1.size());
return address_v6::bytes_type().size() * 8
- common_bits(b1.data(), b2.data(), b1.size());
#endif
}

View File

@ -1763,7 +1763,7 @@ namespace libtorrent
if (!myip.empty())
{
// TODO: don't trust this blindly
if (myip.size() == address_v4::bytes_type::static_size)
if (myip.size() == address_v4::bytes_type().size())
{
address_v4::bytes_type bytes;
std::copy(myip.begin(), myip.end(), bytes.begin());
@ -1771,7 +1771,7 @@ namespace libtorrent
, aux::session_impl::source_peer, remote().address());
}
#if TORRENT_USE_IPV6
else if (myip.size() == address_v6::bytes_type::static_size)
else if (myip.size() == address_v6::bytes_type().size())
{
address_v6::bytes_type bytes;
std::copy(myip.begin(), myip.end(), bytes.begin());

View File

@ -508,10 +508,10 @@ namespace libtorrent
if (ip_ent)
{
char const* p = ip_ent->string_ptr();
if (ip_ent->string_length() == address_v4::bytes_type::static_size)
if (ip_ent->string_length() == address_v4::bytes_type().size())
external_ip = detail::read_v4_address(p);
#if TORRENT_USE_IPV6
else if (ip_ent->string_length() == address_v6::bytes_type::static_size)
else if (ip_ent->string_length() == address_v6::bytes_type().size())
external_ip = detail::read_v6_address(p);
#endif
}