diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 9926f90d6..ebd450837 100755 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -14,10 +14,12 @@ rule libtorrent_linking ( properties * ) result += on ; } -# if gcc in $(properties) || darwin in $(properties) -# { -# result += hidden ; -# } + if gcc in $(properties) + || darwin in $(properties) + || clang in $(properties) + { + result += -fvisibility=hidden ; + } # when building peer_plugin.cpp on msvc-7.1 it fails # running out of internal heap space. Don't add it @@ -35,11 +37,11 @@ rule libtorrent_linking ( properties * ) { if static in $(properties) || static in $(properties) { - result += /boost/python//boost_python/static ; + result += /boost/python//boost_python/static ; } else { - result += /boost/python//boost_python/shared ; + result += /boost/python//boost_python/shared ; } } else diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp index c7030a796..db7a867e3 100644 --- a/bindings/python/src/create_torrent.cpp +++ b/bindings/python/src/create_torrent.cpp @@ -52,6 +52,9 @@ namespace { ct.add_file(fe); } + + char const* filestorage_name(file_storage const& fs) + { return fs.name().c_str(); } } void bind_create_torrent() @@ -62,8 +65,10 @@ void bind_create_torrent() #endif void (file_storage::*set_name0)(std::string const&) = &file_storage::set_name; + void (file_storage::*rename_file0)(int, std::string const&) = &file_storage::rename_file; #if TORRENT_USE_WSTRING void (file_storage::*set_name1)(std::wstring const&) = &file_storage::set_name; + void (file_storage::*rename_file1)(int, std::wstring const&) = &file_storage::rename_file; #endif #ifndef BOOST_NO_EXCEPTIONS @@ -95,10 +100,12 @@ void bind_create_torrent() .def("piece_length", &file_storage::piece_length) .def("piece_size", &file_storage::piece_size) .def("set_name", set_name0) + .def("rename_file", rename_file0) #if TORRENT_USE_WSTRING .def("set_name", set_name1) + .def("rename_file", rename_file1) #endif - .def("name", &file_storage::name, return_internal_reference<>()) + .def("name", &filestorage_name) ; class_("create_torrent", no_init)