some vs2010 fixes
This commit is contained in:
parent
d6d577627b
commit
562e2512b9
|
@ -179,6 +179,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// class X needs to have dll-interface to be used by clients of class Y
|
||||
#pragma warning(disable:4251)
|
||||
// '_vsnprintf': This function or variable may be unsafe
|
||||
#pragma warning(disable:4996)
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace detail
|
|||
TORRENT_ASSERT(!m_access_list.empty());
|
||||
TORRENT_ASSERT(i != m_access_list.end());
|
||||
|
||||
if (i != j) m_access_list.erase(next(i), j);
|
||||
if (i != j) m_access_list.erase(boost::next(i), j);
|
||||
if (i->start == first)
|
||||
{
|
||||
// we can do this const-cast because we know that the new
|
||||
|
|
|
@ -405,7 +405,7 @@ namespace libtorrent
|
|||
|
||||
using boost::bind;
|
||||
std::sort(m_urls.begin(), m_urls.end()
|
||||
, bind(&announce_entry::second, _1) < bind(&announce_entry::second, _2));
|
||||
, boost::bind(&announce_entry::second, _1) < boost::bind(&announce_entry::second, _2));
|
||||
}
|
||||
|
||||
void create_torrent::set_hash(int index, sha1_hash const& h)
|
||||
|
|
|
@ -1256,7 +1256,7 @@ namespace libtorrent
|
|||
{
|
||||
if (!handler) return;
|
||||
|
||||
m_ios.post(bind(handler, ret, j));
|
||||
m_ios.post(boost::bind(handler, ret, j));
|
||||
}
|
||||
|
||||
enum action_flags_t
|
||||
|
|
|
@ -47,6 +47,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/parse_url.hpp"
|
||||
|
||||
#ifdef TORRENT_WINDOWS
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
// windows part
|
||||
|
||||
#include "libtorrent/utf8.hpp"
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
#include <direct.h> // for _getcwd, _mkdir
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace libtorrent { namespace dht
|
|||
|
||||
m_refresh_timer.expires_from_now(seconds(5), ec);
|
||||
m_refresh_timer.async_wait(bind(&dht_tracker::refresh_timeout, self(), _1));
|
||||
m_dht.bootstrap(initial_nodes, bind(&dht_tracker::on_bootstrap, self(), _1));
|
||||
m_dht.bootstrap(initial_nodes, boost::bind(&dht_tracker::on_bootstrap, self(), _1));
|
||||
}
|
||||
|
||||
void dht_tracker::stop()
|
||||
|
|
|
@ -109,9 +109,9 @@ void traversal_algorithm::finished(udp::endpoint const& ep)
|
|||
std::vector<result>::iterator i = std::find_if(
|
||||
m_results.begin()
|
||||
, m_results.end()
|
||||
, bind(
|
||||
, boost::bind(
|
||||
std::equal_to<udp::endpoint>()
|
||||
, bind(&result::endpoint, _1)
|
||||
, boost::bind(&result::endpoint, _1)
|
||||
, ep
|
||||
)
|
||||
);
|
||||
|
@ -147,9 +147,9 @@ void traversal_algorithm::failed(udp::endpoint const& ep, int flags)
|
|||
std::vector<result>::iterator i = std::find_if(
|
||||
m_results.begin()
|
||||
, m_results.end()
|
||||
, bind(
|
||||
, boost::bind(
|
||||
std::equal_to<udp::endpoint>()
|
||||
, bind(&result::endpoint, _1)
|
||||
, boost::bind(&result::endpoint, _1)
|
||||
, ep
|
||||
)
|
||||
);
|
||||
|
|
|
@ -109,7 +109,8 @@ void lsd::announce(sha1_hash const& ih, int listen_port)
|
|||
#endif
|
||||
|
||||
m_broadcast_timer.expires_from_now(milliseconds(250 * m_retry_count), ec);
|
||||
m_broadcast_timer.async_wait(bind(&lsd::resend_announce, self(), _1, std::string(msg)));
|
||||
m_broadcast_timer.async_wait(boost::bind(&lsd::resend_announce, self(), _1
|
||||
, std::string(msg)));
|
||||
}
|
||||
|
||||
void lsd::resend_announce(error_code const& e, std::string msg)
|
||||
|
@ -124,7 +125,7 @@ void lsd::resend_announce(error_code const& e, std::string msg)
|
|||
return;
|
||||
|
||||
m_broadcast_timer.expires_from_now(milliseconds(250 * m_retry_count), ec);
|
||||
m_broadcast_timer.async_wait(bind(&lsd::resend_announce, self(), _1, msg));
|
||||
m_broadcast_timer.async_wait(boost::bind(&lsd::resend_announce, self(), _1, msg));
|
||||
}
|
||||
|
||||
void lsd::on_announce(udp::endpoint const& from, char* buffer
|
||||
|
|
|
@ -1690,8 +1690,8 @@ namespace aux {
|
|||
&& !m_torrents.empty())
|
||||
{
|
||||
torrent_map::iterator i = std::max_element(m_torrents.begin(), m_torrents.end()
|
||||
, bind(&torrent::num_peers, bind(&torrent_map::value_type::second, _1))
|
||||
< bind(&torrent::num_peers, bind(&torrent_map::value_type::second, _2)));
|
||||
, boost::bind(&torrent::num_peers, boost::bind(&torrent_map::value_type::second, _1))
|
||||
< boost::bind(&torrent::num_peers, boost::bind(&torrent_map::value_type::second, _2)));
|
||||
|
||||
TORRENT_ASSERT(i != m_torrents.end());
|
||||
int peers_to_disconnect = (std::min)((std::max)(int(i->second->num_peers()
|
||||
|
@ -2251,7 +2251,7 @@ namespace aux {
|
|||
if (m_dht && params.ti)
|
||||
{
|
||||
torrent_info::nodes_t const& nodes = params.ti->nodes();
|
||||
std::for_each(nodes.begin(), nodes.end(), bind(
|
||||
std::for_each(nodes.begin(), nodes.end(), boost::bind(
|
||||
(void(dht::dht_tracker::*)(std::pair<std::string, int> const&))
|
||||
&dht::dht_tracker::add_node
|
||||
, boost::ref(m_dht), _1));
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace libtorrent { namespace
|
|||
{
|
||||
if (i->first.block_index == pb.block_index)
|
||||
{
|
||||
m_torrent.filesystem().async_read(r, bind(&smart_ban_plugin::on_read_ok_block
|
||||
m_torrent.filesystem().async_read(r, boost::bind(&smart_ban_plugin::on_read_ok_block
|
||||
, shared_from_this(), *i, _1, _2));
|
||||
m_block_crc.erase(i++);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue