fix python binding build with no deprecated functions

This commit is contained in:
arvidn 2015-07-27 15:33:36 -07:00
parent 7f695f05d5
commit 75dc8b7997
4 changed files with 8 additions and 4 deletions

View File

@ -58,12 +58,13 @@ struct bytes_from_python
} }
}; };
#ifndef TORRENT_NO_DEPRECATE
object client_fingerprint_(peer_id const& id) object client_fingerprint_(peer_id const& id)
{ {
boost::optional<fingerprint> result = client_fingerprint(id); boost::optional<fingerprint> result = client_fingerprint(id);
return result ? object(*result) : object(); return result ? object(*result) : object();
} }
#endif
entry bdecode_(bytes const& data) entry bdecode_(bytes const& data)
{ {
@ -85,8 +86,8 @@ void bind_utility()
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
def("identify_client", &libtorrent::identify_client); def("identify_client", &libtorrent::identify_client);
#endif
def("client_fingerprint", &client_fingerprint_); def("client_fingerprint", &client_fingerprint_);
#endif
def("bdecode", &bdecode_); def("bdecode", &bdecode_);
def("bencode", &bencode_); def("bencode", &bencode_);
} }

View File

@ -39,13 +39,14 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "libtorrent/export.hpp"
namespace libtorrent namespace libtorrent
{ {
// The fingerprint class represents information about a client and its version. It is used // The fingerprint class represents information about a client and its version. It is used
// to encode this information into the client's peer id. // to encode this information into the client's peer id.
struct fingerprint struct TORRENT_DEPRECATED_EXPORT fingerprint
{ {
// The constructor takes a ``char const*`` that should point to a string constant containing // The constructor takes a ``char const*`` that should point to a string constant containing

View File

@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent namespace libtorrent
{ {
// TODO: hide these declarations when deprecaated functions are disabled, and // TODO: hide these declarations when deprecaated functions are disabled, and
// expose them internally in a header under aux_. // expose them internally in a header under aux_.
@ -65,6 +66,7 @@ namespace libtorrent
TORRENT_DEPRECATED_EXPORT TORRENT_DEPRECATED TORRENT_DEPRECATED_EXPORT TORRENT_DEPRECATED
boost::optional<fingerprint> boost::optional<fingerprint>
client_fingerprint(peer_id const& p); client_fingerprint(peer_id const& p);
} }
#endif // TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED #endif // TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED

View File

@ -44,7 +44,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/version.hpp" #include "libtorrent/version.hpp"
#include "libtorrent/fingerprint.hpp"
#include "libtorrent/build_config.hpp" #include "libtorrent/build_config.hpp"
#include "libtorrent/settings_pack.hpp" #include "libtorrent/settings_pack.hpp"
#include "libtorrent/io_service.hpp" #include "libtorrent/io_service.hpp"
@ -56,6 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
#include "libtorrent/rss.hpp" #include "libtorrent/rss.hpp"
#include "libtorrent/fingerprint.hpp"
#endif #endif
#ifdef TORRENT_USE_OPENSSL #ifdef TORRENT_USE_OPENSSL