more patches in order to get it to build on vc7

This commit is contained in:
Arvid Norberg 2006-01-08 22:55:02 +00:00
parent bad06d0c4e
commit 01820e5579
2 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,4 @@
* made libtorrent build in vc7 (patches from Allen Zhao)
* fixed bug caused when binding outgoing connections to a non-local interface. * fixed bug caused when binding outgoing connections to a non-local interface.
* add_torrent() will now throw if called while the session object is * add_torrent() will now throw if called while the session object is
being closed. being closed.

View File

@ -205,6 +205,7 @@ using namespace boost::filesystem;
namespace pt = boost::posix_time; namespace pt = boost::posix_time;
using boost::bind; using boost::bind;
using namespace ::boost::multi_index; using namespace ::boost::multi_index;
using boost::multi_index::multi_index_container;
namespace namespace
{ {
@ -251,8 +252,8 @@ namespace
{ {
assert(st != 0); assert(st != 0);
assert(p.is_complete()); assert(p.is_complete());
typedef file_set::nth_index<0>::type path_view; typedef nth_index<file_set, 0>::type path_view;
path_view& pt = m_files.get<0>(); path_view& pt = get<0>(m_files);
path_view::iterator i = pt.find(p); path_view::iterator i = pt.find(p);
if (i != pt.end()) if (i != pt.end())
{ {
@ -282,8 +283,8 @@ namespace
{ {
// the file cache is at its maximum size, close // the file cache is at its maximum size, close
// the least recently used (lru) file from it // the least recently used (lru) file from it
typedef file_set::nth_index<1>::type lru_view; typedef nth_index<file_set, 1>::type lru_view;
lru_view& lt = m_files.get<1>(); lru_view& lt = get<1>(m_files);
lru_view::iterator i = lt.begin(); lru_view::iterator i = lt.begin();
// the first entry in this view is the least recently used // the first entry in this view is the least recently used
/* for (lru_view::iterator i = lt.begin(); i != lt.end(); ++i) /* for (lru_view::iterator i = lt.begin(); i != lt.end(); ++i)
@ -306,8 +307,8 @@ namespace
assert(st != 0); assert(st != 0);
using boost::tie; using boost::tie;
typedef file_set::nth_index<2>::type key_view; typedef nth_index<file_set, 2>::type key_view;
key_view& kt = m_files.get<2>(); key_view& kt = get<2>(m_files);
key_view::iterator start, end; key_view::iterator start, end;
tie(start, end) = kt.equal_range(st); tie(start, end) = kt.equal_range(st);
@ -332,7 +333,7 @@ namespace
private: private:
int m_size; int m_size;
typedef boost::multi_index_container< typedef multi_index_container<
file_entry, indexed_by< file_entry, indexed_by<
ordered_unique<member<file_entry, path ordered_unique<member<file_entry, path
, &file_entry::file_path> > , &file_entry::file_path> >