From 33bf3c827ff6c2c9aea0483c5d435409b5104187 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 28 Apr 2018 16:51:50 +0200 Subject: [PATCH] fix deprecation markups --- include/libtorrent/alert_types.hpp | 48 +++++++++++++++++++-------- include/libtorrent/bdecode.hpp | 2 +- include/libtorrent/io_service_fwd.hpp | 1 + include/libtorrent/torrent_status.hpp | 2 +- include/libtorrent/upnp.hpp | 2 +- 5 files changed, 38 insertions(+), 17 deletions(-) diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 8d558a50a..b740ec861 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -104,7 +104,6 @@ namespace libtorrent { public: std::string TORRENT_DEPRECATED_MEMBER name; #endif - }; // The peer alert is a base class for alerts that refer to a specific peer. It includes all @@ -130,7 +129,7 @@ namespace libtorrent { #ifndef TORRENT_NO_DEPRECATE // The peer's IP address and port. - aux::noexcept_movable ip; + aux::noexcept_movable TORRENT_DEPRECATED_MEMBER ip; #endif }; @@ -247,7 +246,7 @@ namespace libtorrent { int const size; #ifndef TORRENT_NO_DEPRECATE - error_code ec; + error_code TORRENT_DEPRECATED_MEMBER ec; #endif }; @@ -484,7 +483,7 @@ namespace libtorrent { aux::allocation_slot m_msg_idx; #ifndef TORRENT_NO_DEPRECATE public: - int const status_code; + int const TORRENT_DEPRECATED_MEMBER status_code; std::string TORRENT_DEPRECATED_MEMBER msg; #endif }; @@ -1101,7 +1100,7 @@ namespace libtorrent { #ifndef TORRENT_NO_DEPRECATE // points to the resume data. - std::shared_ptr resume_data; + std::shared_ptr TORRENT_DEPRECATED_MEMBER resume_data; #endif }; @@ -1361,7 +1360,15 @@ namespace libtorrent { struct TORRENT_EXPORT listen_failed_alert final : alert { #ifndef TORRENT_NO_DEPRECATE - enum socket_type_t : std::uint8_t { tcp, tcp_ssl, udp, i2p, socks5, utp_ssl }; + enum socket_type_t : std::uint8_t + { + tcp TORRENT_DEPRECATED_ENUM, + tcp_ssl TORRENT_DEPRECATED_ENUM, + udp TORRENT_DEPRECATED_ENUM, + i2p TORRENT_DEPRECATED_ENUM, + socks5 TORRENT_DEPRECATED_ENUM, + utp_ssl TORRENT_DEPRECATED_ENUM + }; #endif // internal @@ -1439,7 +1446,15 @@ namespace libtorrent { struct TORRENT_EXPORT listen_succeeded_alert final : alert { #ifndef TORRENT_NO_DEPRECATE - enum socket_type_t : std::uint8_t { tcp, tcp_ssl, udp, i2p, socks5, utp_ssl }; + enum socket_type_t : std::uint8_t + { + tcp TORRENT_DEPRECATED_ENUM, + tcp_ssl TORRENT_DEPRECATED_ENUM, + udp TORRENT_DEPRECATED_ENUM, + i2p TORRENT_DEPRECATED_ENUM, + socks5 TORRENT_DEPRECATED_ENUM, + utp_ssl TORRENT_DEPRECATED_ENUM + }; #endif // internal @@ -1474,10 +1489,10 @@ namespace libtorrent { #ifndef TORRENT_NO_DEPRECATE // the endpoint libtorrent ended up listening on. The address // refers to the local interface and the port is the listen port. - aux::noexcept_movable endpoint; + aux::noexcept_movable TORRENT_DEPRECATED_MEMBER endpoint; // the type of listen socket this alert refers to. - socket_type_t sock_type; + socket_type_t TORRENT_DEPRECATED_MEMBER sock_type; #endif }; @@ -1544,7 +1559,7 @@ namespace libtorrent { portmap_transport const map_transport; #ifndef TORRENT_NO_DEPRECATE - enum protocol_t + enum TORRENT_DEPRECATED_ENUM protocol_t { tcp, udp @@ -2028,12 +2043,19 @@ namespace libtorrent { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif #endif TORRENT_DEFINE_ALERT_PRIO(session_stats_alert, 70) #ifndef TORRENT_NO_DEPRECATE #ifdef __GNUC__ #pragma GCC diagnostic pop #endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #endif static constexpr alert_category_t static_category = alert::stats_notification; @@ -2052,11 +2074,9 @@ namespace libtorrent { #ifdef TORRENT_NO_DEPRECATE private: - // TODO: allocate this on the alert_stack in the future - std::array const values; -#else - std::array const TORRENT_DEPRECATED_MEMBER values; #endif + // TODO: allocate this on the alert_stack in the future + std::array const TORRENT_DEPRECATED_MEMBER values; }; #ifndef TORRENT_NO_DEPRECATE diff --git a/include/libtorrent/bdecode.hpp b/include/libtorrent/bdecode.hpp index 690ebd5ed..7f9d21fbc 100644 --- a/include/libtorrent/bdecode.hpp +++ b/include/libtorrent/bdecode.hpp @@ -103,7 +103,7 @@ namespace libtorrent { TORRENT_EXPORT boost::system::error_category& bdecode_category(); -#ifndef TORRENT_NO_DEPRECATED +#ifndef TORRENT_NO_DEPRECATE TORRENT_DEPRECATED inline boost::system::error_category& get_bdecode_category() { return bdecode_category(); } diff --git a/include/libtorrent/io_service_fwd.hpp b/include/libtorrent/io_service_fwd.hpp index 0f30d4d22..1b22c3e58 100644 --- a/include/libtorrent/io_service_fwd.hpp +++ b/include/libtorrent/io_service_fwd.hpp @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_IO_SERVICE_FWD_HPP_INCLUDED #include "libtorrent/config.hpp" +#include #if defined TORRENT_BUILD_SIMULATOR namespace sim { namespace asio { diff --git a/include/libtorrent/torrent_status.hpp b/include/libtorrent/torrent_status.hpp index e84a20131..a4acb0914 100644 --- a/include/libtorrent/torrent_status.hpp +++ b/include/libtorrent/torrent_status.hpp @@ -87,7 +87,7 @@ namespace libtorrent { // The torrent is in the queue for being checked. But there // currently is another torrent that are being checked. // This torrent will wait for its turn. - queued_for_checking, + queued_for_checking TORRENT_DEPRECATED_ENUM, #else // internal unused_enum_for_backwards_compatibility, diff --git a/include/libtorrent/upnp.hpp b/include/libtorrent/upnp.hpp index 923df10d3..37f4e2317 100644 --- a/include/libtorrent/upnp.hpp +++ b/include/libtorrent/upnp.hpp @@ -95,7 +95,7 @@ namespace libtorrent { // the boost.system error category for UPnP errors TORRENT_EXPORT boost::system::error_category& upnp_category(); -#ifndef TORRENT_NO_DEPRECATED +#ifndef TORRENT_NO_DEPRECATE TORRENT_DEPRECATED inline boost::system::error_category& get_upnp_category() { return upnp_category(); }