fix deprecated warning with msvc (#1265)

fix deprecated warning with msvc
This commit is contained in:
Alden Torres 2016-10-27 18:09:15 -04:00 committed by Arvid Norberg
parent b65c89a000
commit 877a47e03b
4 changed files with 37 additions and 1 deletions

View File

@ -11,6 +11,18 @@ void bind_fingerprint()
using namespace libtorrent;
#ifndef TORRENT_NO_DEPRECATE
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#pragma warning(disable: 4996)
#endif
class_<fingerprint>("fingerprint", no_init)
.def(
init<char const*,int,int,int,int>(
@ -24,6 +36,14 @@ void bind_fingerprint()
.def_readonly("revision_version", &fingerprint::revision_version)
.def_readonly("tag_version", &fingerprint::tag_version)
;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif // TORRENT_NO_DEPRECATE
}

View File

@ -362,6 +362,7 @@ namespace libtorrent
// functions on torrent_handle
int max_uploads = -1;
int max_connections = -1;
int upload_limit = -1;
int download_limit = -1;
@ -403,6 +404,7 @@ namespace libtorrent
// have not received any scrape data.
int num_complete = -1;
int num_incomplete = -1;
int num_downloaded = -1;
// URLs can be added to these two lists to specify additional web

View File

@ -66,6 +66,10 @@ namespace libtorrent
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#pragma warning(disable: 4996)
#endif
// Returns an optional fingerprint if any can be identified from the peer
// id. This can be used to automate the identification of clients. It will
@ -81,6 +85,9 @@ namespace libtorrent
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif // TORRENT_NO_DEPRECATE

View File

@ -264,6 +264,10 @@ namespace libtorrent
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#pragma warning(disable: 4996)
#endif
TORRENT_DEPRECATED
session(fingerprint const& print
@ -323,6 +327,9 @@ namespace libtorrent
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif // TORRENT_NO_DEPRECATE
// The destructor of session will notify all trackers that our torrents