fix deprecated warnings in msvc (#1272)

fix deprecated warnings in msvc and merge issue.
This commit is contained in:
Arvid Norberg 2016-10-29 21:10:40 -04:00 committed by GitHub
parent b97bb84a9f
commit d1e916ec9e
2 changed files with 31 additions and 1 deletions

View File

@ -1839,6 +1839,15 @@ namespace libtorrent
};
#ifndef TORRENT_NO_DEPRECATE
#ifdef _MSC_VER
#pragma warning(push, 1)
// warning C4996: X: was declared deprecated
#pragma warning( disable : 4996 )
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
struct TORRENT_DEPRECATED TORRENT_EXPORT mmap_cache_alert final : alert
{
mmap_cache_alert(aux::stack_allocator& alloc
@ -1850,6 +1859,12 @@ namespace libtorrent
error_code const error;
};
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
// The session_stats_alert is posted when the user requests session statistics by
@ -1885,6 +1900,15 @@ namespace libtorrent
//
// Once this download completes, the ``torrent_update_alert`` is posted to
// notify the client of the info-hash changing.
#ifdef _MSC_VER
#pragma warning(push, 1)
// warning C4996: X: was declared deprecated
#pragma warning( disable : 4996 )
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
struct TORRENT_DEPRECATED TORRENT_EXPORT torrent_update_alert final : torrent_alert
{
// internal
@ -1900,6 +1924,12 @@ namespace libtorrent
sha1_hash old_ih;
sha1_hash new_ih;
};
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
// posted when something fails in the DHT. This is not necessarily a fatal

View File

@ -143,7 +143,7 @@ namespace libtorrent
// don't have ``mmap`` this setting is ignored.
mmap_cache,
#else
deprecated12,
deprecated21,
#endif
// this is the client name and version identifier sent to peers in the