msvc build fixes

This commit is contained in:
Arvid Norberg 2009-09-06 00:57:01 +00:00
parent 562450f545
commit 6d01cb475c
6 changed files with 26 additions and 15 deletions

View File

@ -1303,7 +1303,7 @@ namespace libtorrent
, buffer_operation = 4
};
static const uint8_t action_flags[] =
static const boost::uint8_t action_flags[] =
{
read_operation + buffer_operation // read
, buffer_operation // write

View File

@ -64,7 +64,11 @@ using boost::bind;
namespace libtorrent
{
#if TORRENT_USE_I2P
// defined in torrent_info.cpp
bool is_i2p_url(std::string const& url);
#endif
http_tracker_connection::http_tracker_connection(
io_service& ios
, connection_queue& cc
@ -110,8 +114,6 @@ namespace libtorrent
}
#if TORRENT_USE_I2P
// defined in torrent_info.cpp
bool is_i2p_url(std::string const& url);
bool i2p = is_i2p_url(url);
#else
static const bool i2p = false;
@ -516,10 +518,12 @@ namespace libtorrent
incomplete = int(incomplete_ent->integer());
std::list<address> ip_list;
std::transform(m_tracker_connection->endpoints().begin()
, m_tracker_connection->endpoints().end()
, std::back_inserter(ip_list)
, boost::bind(&tcp::endpoint::address, _1));
std::list<tcp::endpoint> const& epts = m_tracker_connection->endpoints();
for (std::list<tcp::endpoint>::const_iterator i = epts.begin()
, end(epts.end()); i != end; ++i)
{
ip_list.push_back(i->address());
}
cb->tracker_response(tracker_req(), m_tracker_ip, ip_list, peer_list
, interval->integer(), complete, incomplete, external_ip);

View File

@ -55,6 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/torrent_info.hpp"
@ -3875,12 +3876,16 @@ namespace libtorrent
// this asserts that we don't have duplicates in the policy's peer list
peer_iterator i_ = std::find_if(m_connections.begin(), m_connections.end()
, bind(&peer_connection::remote, _1) == peerinfo->ip());
#if TORRENT_USE_I2P
TORRENT_ASSERT(i_ == m_connections.end()
|| dynamic_cast<bt_peer_connection*>(*i_) == 0
#if TORRENT_USE_I2P
|| peerinfo->is_i2p_addr
#endif
);
#else
TORRENT_ASSERT(i_ == m_connections.end()
|| dynamic_cast<bt_peer_connection*>(*i_) == 0
);
#endif
#endif
TORRENT_ASSERT(want_more_peers());

View File

@ -55,6 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/torrent_info.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/hasher.hpp"

View File

@ -439,10 +439,11 @@ namespace libtorrent
}
std::list<address> ip_list;
std::transform(m_endpoints.begin()
, m_endpoints.end()
, std::back_inserter(ip_list)
, boost::bind(&udp::endpoint::address, _1));
for (std::list<udp::endpoint>::const_iterator i = m_endpoints.begin()
, end(m_endpoints.end()); i != end; ++i)
{
ip_list.push_back(i->address());
}
cb->tracker_response(tracker_req(), m_target.address(), ip_list
, peer_list, interval, complete, incomplete, address());

View File

@ -251,7 +251,7 @@ void run_elevator_test()
// test the elevator going up
add_job_up(dio, 0, pm);
uint32_t p = 1234513;
boost::uint32_t p = 1234513;
for (int i = 0; i < 100; ++i)
{
p *= 123;