fix unknown pragma warning on msvc

This commit is contained in:
arvidn 2015-08-20 21:14:39 +02:00
parent 206e4b7c71
commit 40a67ecbc8
4 changed files with 25 additions and 1 deletions

View File

@ -267,8 +267,10 @@ namespace libtorrent {
#ifndef TORRENT_NO_DEPRECATE
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
// determines whether or not an alert is allowed to be discarded
// when the alert queue is full. There are a few alerts which may not be discared,
@ -289,10 +291,12 @@ namespace libtorrent {
virtual std::auto_ptr<alert> clone_impl() const = 0;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif // TORRENT_NO_DEPRECATE
private:
// explicitly disallow assignment, to silence msvc warning
alert& operator=(alert const&);

View File

@ -895,13 +895,17 @@ namespace libtorrent
TORRENT_DEPRECATED
void pop_alerts(std::deque<alert*>* alerts);
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
TORRENT_DEPRECATED
std::auto_ptr<alert> pop_alert();
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif
@ -980,8 +984,10 @@ namespace libtorrent
TORRENT_DEPRECATED
boost::uint32_t get_alert_mask() const;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
// This sets a function to be called (from within libtorrent's netowrk
// thread) every time an alert is posted. Since the function (``fun``) is
@ -995,7 +1001,9 @@ namespace libtorrent
void set_alert_dispatch(
boost::function<void(std::auto_ptr<alert>)> const& fun);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
// Starts and stops Local Service Discovery. This service will broadcast
// the infohashes of all the non-private torrents on the local network to

View File

@ -117,8 +117,10 @@ namespace libtorrent
return false;
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void alert_manager::set_dispatch_function(
boost::function<void(std::auto_ptr<alert>)> const& fun)
@ -141,7 +143,9 @@ namespace libtorrent
}
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

View File

@ -838,8 +838,10 @@ namespace libtorrent
return TORRENT_SYNC_CALL_RET(int, max_connections);
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
std::auto_ptr<alert> session_handle::pop_alert()
{
@ -848,7 +850,9 @@ namespace libtorrent
return a->clone();
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
void session_handle::pop_alerts(std::deque<alert*>* alerts)
{
@ -911,15 +915,19 @@ namespace libtorrent
return get_settings().get_int(settings_pack::alert_mask);
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void session_handle::set_alert_dispatch(boost::function<void(std::auto_ptr<alert>)> const& fun)
{
m_impl->alerts().set_dispatch_function(fun);
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
void session_handle::start_lsd()
{