some boost 1.34 preprocessor conditions and fixed assert in piece_picker

This commit is contained in:
Arvid Norberg 2007-04-23 17:14:40 +00:00
parent e5a20b8de6
commit 094dc1065c
5 changed files with 11 additions and 4 deletions

View File

@ -328,7 +328,6 @@ typedef std::multimap<std::string, libtorrent::torrent_handle> handles_t;
using boost::bind; using boost::bind;
using boost::filesystem::path; using boost::filesystem::path;
using boost::filesystem::exists; using boost::filesystem::exists;
using boost::filesystem::no_check;
using boost::filesystem::directory_iterator; using boost::filesystem::directory_iterator;
using boost::filesystem::extension; using boost::filesystem::extension;
@ -443,7 +442,10 @@ void scan_dir(path const& dir_path
int main(int ac, char* av[]) int main(int ac, char* av[])
{ {
#if BOOST_VERSION < 103400
using boost::filesystem::no_check;
path::default_name_check(no_check); path::default_name_check(no_check);
#endif
int listen_port; int listen_port;
float preferred_ratio; float preferred_ratio;

View File

@ -49,8 +49,9 @@ int main(int argc, char* argv[])
std::cerr << "usage: dump_torrent torrent-file\n"; std::cerr << "usage: dump_torrent torrent-file\n";
return 1; return 1;
} }
#if BOOST_VERSION < 103400
boost::filesystem::path::default_name_check(boost::filesystem::no_check); boost::filesystem::path::default_name_check(boost::filesystem::no_check);
#endif
try try
{ {

View File

@ -45,9 +45,10 @@ POSSIBILITY OF SUCH DAMAGE.
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
using namespace libtorrent; using namespace libtorrent;
#if BOOST_VERSION < 103400
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
fs::path::default_name_check(fs::no_check); fs::path::default_name_check(fs::no_check);
#endif
if (argc != 2) if (argc != 2)
{ {

View File

@ -725,7 +725,8 @@ namespace libtorrent
assert(m_piece_info[last_index].empty()); assert(m_piece_info[last_index].empty());
if (last_index >= cap_index) if (last_index >= cap_index)
{ {
assert(m_piece_info[cap_index - 1].empty()); assert(pushed_out_index == cap_index - 1
|| m_piece_info[cap_index - 1].empty());
m_piece_info[cap_index].swap(m_piece_info[cap_index - 2]); m_piece_info[cap_index].swap(m_piece_info[cap_index - 2]);
if (cap_index == pushed_out_index) if (cap_index == pushed_out_index)
pushed_out_index = cap_index - 2; pushed_out_index = cap_index - 2;

View File

@ -88,9 +88,11 @@ namespace libtorrent
{ {
filesystem_init::filesystem_init() filesystem_init::filesystem_init()
{ {
#if BOOST_VERSION < 103400
using namespace boost::filesystem; using namespace boost::filesystem;
if (path::default_name_check_writable()) if (path::default_name_check_writable())
path::default_name_check(no_check); path::default_name_check(no_check);
#endif
} }
} }