fix build issues in python bindings

This commit is contained in:
Arvid Norberg
2009-10-29 06:45:46 +00:00
parent 86488f95e7
commit 33d6969684
2 changed files with 7 additions and 1 deletions

View File

@@ -38,7 +38,9 @@ void bind_create_torrent()
#endif
void (file_storage::*set_name0)(std::string const&) = &file_storage::set_name;
#if TORRENT_USE_WSTRING
void (file_storage::*set_name1)(std::wstring const&) = &file_storage::set_name;
#endif
void (*set_piece_hashes0)(create_torrent&, std::string const&) = &set_piece_hashes;
void (*add_files0)(file_storage&, std::string const&) = add_files;
@@ -59,7 +61,9 @@ void bind_create_torrent()
.def("piece_length", &file_storage::piece_length)
.def("piece_size", &file_storage::piece_size)
.def("set_name", set_name0)
#if TORRENT_USE_WSTRING
.def("set_name", set_name1)
#endif
.def("name", &file_storage::name, return_internal_reference<>())
;

View File

@@ -90,7 +90,7 @@ void bind_torrent_info()
return_value_policy<copy_const_reference> copy;
void (torrent_info::*rename_file0)(int, std::string const&) = &torrent_info::rename_file;
#ifndef BOOST_FILESYSTEM_NARROW_ONLY
#if TORRENT_USE_WSTRING
void (torrent_info::*rename_file1)(int, std::wstring const&) = &torrent_info::rename_file;
#endif
@@ -107,7 +107,9 @@ void bind_torrent_info()
.def(init<sha1_hash const&>())
.def(init<char const*, int>())
.def(init<std::string>())
#if TORRENT_USE_WSTRING
.def(init<std::wstring>())
#endif
.def("add_tracker", &torrent_info::add_tracker, (arg("url"), arg("tier")=0))
.def("add_url_seed", &torrent_info::add_url_seed)