From 2d70a9b5bf0e09180093807e1c6aa5b00d7c91ce Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 10 Jan 2006 00:38:52 +0000 Subject: [PATCH] some more steps in the direction of getting it to build on vc7 --- examples/client_test.cpp | 3 ++- src/policy.cpp | 4 ++-- src/torrent.cpp | 9 ++++++--- src/torrent_info.cpp | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 1e3d180d8..08ba06f5b 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -230,7 +230,8 @@ char const* peer_index(libtorrent::address addr, std::vector::const_iterator i = std::find_if(peers.begin() - , peers.end(), bind(std::equal_to
(), bind(&peer_info::ip, _1), addr)); + , peers.end(), boost::bind(std::equal_to
() + , bind(&peer_info::ip, _1), addr)); if (i == peers.end()) return "+"; static char str[] = " "; diff --git a/src/policy.cpp b/src/policy.cpp index e27027170..d0f8a5578 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -1080,8 +1080,8 @@ namespace libtorrent INVARIANT_CHECK; assert(std::find_if(m_peers.begin(), m_peers.end() - , bind(std::equal_to(), bind(&peer::connection, _1) - , &c)) != m_peers.end()); + , boost::bind(std::equal_to(), bind(&peer::connection, _1) + , &c)) != m_peers.end()); // if the peer is choked and we have upload slots left, // then unchoke it. Another condition that has to be met diff --git a/src/torrent.cpp b/src/torrent.cpp index 7feb82baa..54b85a4ca 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -484,7 +484,8 @@ namespace libtorrent // if we don't have the metadata yet, we // cannot tell how big the torrent is. if (!valid_metadata()) return -1; - return m_torrent_file.total_size() - get<0>(bytes_done()); + return m_torrent_file.total_size() + - boost::tuples::get<0>(bytes_done()); } // the first value is the total number of bytes downloaded @@ -1379,8 +1380,10 @@ namespace libtorrent st.num_peers = (int)std::count_if(m_connections.begin(), m_connections.end(), - bind(std::logical_not(), boost::bind(&peer_connection::is_connecting, - boost::bind(&std::map::value_type::second, _1)))); + boost::bind(std::logical_not(), boost::bind( + &peer_connection::is_connecting + , boost::bind(&std::map
::value_type::second, _1)))); st.num_complete = m_complete; st.num_incomplete = m_incomplete; diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index bfab00be3..c1ac17c31 100755 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -361,7 +361,7 @@ namespace libtorrent m_urls.push_back(e); using boost::bind; - std::sort(m_urls.begin(), m_urls.end(), bind(std::less() + std::sort(m_urls.begin(), m_urls.end(), boost::bind(std::less() , bind(&announce_entry::tier, _1), bind(&announce_entry::tier, _2))); }