raise warning level. fix a few of them. filter out warnings from boost

This commit is contained in:
Arvid Norberg 2015-04-18 02:33:39 +00:00
parent 1b20755c03
commit 408232cfc8
99 changed files with 724 additions and 592 deletions

52
Jamfile
View File

@ -225,6 +225,33 @@ rule linking ( properties * )
return $(result) ;
}
rule warnings ( properties * )
{
local result ;
if <toolset>clang in $(properties)
|| <toolset>darwin in $(properties)
{
result += <cflags>-Weverything ;
result += <cflags>-Wno-documentation ;
result += <cflags>-Wno-c++98-compat-pedantic ;
result += <cflags>-Wno-padded ;
result += <cflags>-Wno-global-constructors ;
result += <cflags>-Wno-c++98-compat ;
result += <cflags>-Wno-exit-time-destructors ;
result += <cflags>-Wno-documentation-unknown-command ;
result += <cflags>-Wno-disabled-macro-expansion ;
}
if <toolset>msvc in $(properties)
{
# disable warning C4503: decorated name length exceeded, name was truncated
result += <cflags>/wd4503 ;
result += <cflags>/W4 ;
}
return $(result) ;
}
# rule for adding the right source files
# depending on target-os and features
rule building ( properties * )
@ -679,26 +706,10 @@ local usage-requirements =
# these compiler settings just makes the compiler standard conforming
<toolset>msvc:<cflags>/Zc:wchar_t
<toolset>msvc:<cflags>/Zc:forScope
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
# msvc optimizations
<toolset>msvc,<variant>release:<linkflags>/OPT:ICF=5
<toolset>msvc,<variant>release:<linkflags>/OPT:REF
# disable warning C4503: decorated name length exceeded, name was truncated
<toolset>msvc:<cxxflags>/wd4503
# disable warning C4275: non-dll interface class 'x' used as base for dll-interface struct 'y'
<toolset>msvc:<cxxflags>/wd4275
# disable warning C4251: 'x' needs to have dll-interface to be used by clients of class 'y'
<toolset>msvc:<cxxflags>/wd4251
# disable some warnings for gcc
<toolset>gcc:<cflags>-fno-strict-aliasing
<toolset>gcc:<cflags>-Wno-missing-braces
<toolset>gcc:<cflags>-Wno-unused-local-typedefs
# suppress warnings caused by boost using c++11 features even when not
# in c++11 mode
<toolset>darwin:<cxxflags>-Wno-c++11-extensions
# assert on integer overflow
<boost>system:<cxxflags>$(CXXFLAGS)
<boost>system:<linkflags>$(LDFLAGS)
# this works around a bug in asio in boost-1.39
@ -736,19 +747,22 @@ lib torrent
<dht>logging:<source>ed25519/src/$(ED25519_SOURCES).cpp
<conditional>@building
<conditional>@warnings
<boost>system:<cxxflags>$(CXXFLAGS)
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
$(usage-requirements)
: # default build
<link>static
<threading>multi
<warnings>all
: # usage requirements
$(usage-requirements)
<link>shared:<define>TORRENT_LINKING_SHARED
;
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;

View File

@ -50,7 +50,7 @@ std::string to_string(int v, int width)
std::string add_suffix(float val, char const* suffix)
{
if (val == 0)
if (val < 0.001f)
{
std::string ret;
ret.resize(4 + 2, ' ');
@ -85,7 +85,7 @@ std::string const& progress_bar(int progress, int width, color_code c
{
static std::string bar;
bar.clear();
bar.reserve(width + 10);
bar.reserve(size_t(width + 10));
int progress_chars = (progress * width + 500) / 1000;
@ -105,7 +105,7 @@ std::string const& progress_bar(int progress, int width, color_code c
if (c == col_black || c == col_blue)
tc = col_white;
caption.resize(width, ' ');
caption.resize(size_t(width), ' ');
char str[256];
if (flags & progress_invert)
@ -180,7 +180,7 @@ void terminal_size(int* terminal_width, int* terminal_height)
#else
int tty = open("/dev/tty", O_RDONLY);
winsize size;
int ret = ioctl(tty, TIOCGWINSZ, (char*)&size);
int ret = ioctl(tty, TIOCGWINSZ, reinterpret_cast<char*>(&size));
close(tty);
if (ret == 0)
{

View File

@ -13,7 +13,7 @@ enum color_code
col_blue = 4,
col_magenta = 5,
col_cyan = 6,
col_white = 7,
col_white = 7
};
char const* esc(char const* code);

View File

@ -36,6 +36,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/version.hpp>
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#ifdef __OBJC__
#define Protocol Protocol_
#endif
@ -51,6 +53,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/ip/address.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#ifdef __OBJC__
#undef Protocol
#endif

View File

@ -38,9 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
@ -48,6 +46,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp>
#include "aux_/disable_warnings_pop.hpp"
// OVERVIEW
//
// The pop_alerts() function on session is the main interface for retrieving
@ -74,10 +74,6 @@ POSSIBILITY OF SUCH DAMAGE.
// call to pop_alerts(). Internal members of alerts also become invalid once
// pop_alerts() is called again.
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/time.hpp"
#include "libtorrent/config.hpp"
@ -273,7 +269,7 @@ namespace libtorrent {
#ifndef BOOST_NO_EXCEPTIONS
#ifndef TORRENT_NO_DEPRECATE
struct TORRENT_EXPORT unhandled_alert : std::exception
struct TORRENT_DEPRECATED TORRENT_EXPORT unhandled_alert : std::exception
{
unhandled_alert() {}
};
@ -286,6 +282,7 @@ namespace libtorrent {
template<class Handler
, BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, class T)>
TORRENT_DEPRECATED
void handle_alert_dispatch(
const std::auto_ptr<alert>& alert_, const Handler& handler
, const std::type_info& typeid_
@ -296,10 +293,11 @@ namespace libtorrent {
else
handle_alert_dispatch(alert_, handler, typeid_
, BOOST_PP_ENUM_SHIFTED_PARAMS(
TORRENT_MAX_ALERT_TYPES, p), (void_*)0);
TORRENT_MAX_ALERT_TYPES, p), reinterpret_cast<void_*>(0));
}
template<class Handler>
TORRENT_DEPRECATED
void handle_alert_dispatch(
const std::auto_ptr<alert>&
, const Handler&
@ -313,13 +311,13 @@ namespace libtorrent {
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
TORRENT_MAX_ALERT_TYPES, class T, detail::void_)>
struct TORRENT_EXPORT handle_alert
struct TORRENT_DEPRECATED TORRENT_EXPORT handle_alert
{
template<class Handler>
handle_alert(const std::auto_ptr<alert>& alert_
, const Handler& handler)
{
#define ALERT_POINTER_TYPE(z, n, text) (BOOST_PP_CAT(T, n)*)0
#define ALERT_POINTER_TYPE(z, n, text) reinterpret_cast<BOOST_PP_CAT(T, n)*>(0)
detail::handle_alert_dispatch(alert_, handler, typeid(*alert_)
, BOOST_PP_ENUM(TORRENT_MAX_ALERT_TYPES, ALERT_POINTER_TYPE, _));

View File

@ -39,6 +39,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/heterogeneous_queue.hpp"
#include "libtorrent/stack_allocator.hpp"
#include "aux_/disable_warnings_push.hpp"
#ifndef TORRENT_NO_DEPRECATE
#include <boost/function/function1.hpp>
#endif
@ -47,6 +49,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list>
#include <utility> // for std::forward
#include "aux_/disable_warnings_pop.hpp"
// used for emplace_alert() variadic template emulation for c++98
#define TORRENT_ALERT_MANAGER_MAX_ARITY 7

View File

@ -166,7 +166,7 @@ namespace libtorrent
// internal
torrent_added_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_added_alert, 3);
TORRENT_DEFINE_ALERT(torrent_added_alert, 3)
static const int static_category = alert::status_notification;
virtual std::string message() const;
};
@ -189,7 +189,7 @@ namespace libtorrent
torrent_removed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_removed_alert, 4);
TORRENT_DEFINE_ALERT_PRIO(torrent_removed_alert, 4)
static const int static_category = alert::status_notification;
virtual std::string message() const;
#ifndef TORRENT_NO_DEPRECATE
@ -213,7 +213,7 @@ namespace libtorrent
, int p, boost::shared_array<char> d, int s);
read_piece_alert(aux::stack_allocator& alloc, torrent_handle h, int p, error_code e);
TORRENT_DEFINE_ALERT_PRIO(read_piece_alert, 5);
TORRENT_DEFINE_ALERT_PRIO(read_piece_alert, 5)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -235,7 +235,7 @@ namespace libtorrent
file_completed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int idx);
TORRENT_DEFINE_ALERT(file_completed_alert, 6);
TORRENT_DEFINE_ALERT(file_completed_alert, 6)
static const int static_category = alert::progress_notification;
virtual std::string message() const;
@ -253,7 +253,7 @@ namespace libtorrent
, std::string const& n
, int idx);
TORRENT_DEFINE_ALERT_PRIO(file_renamed_alert, 7);
TORRENT_DEFINE_ALERT_PRIO(file_renamed_alert, 7)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -280,7 +280,7 @@ namespace libtorrent
, torrent_handle const& h, int idx
, error_code ec);
TORRENT_DEFINE_ALERT_PRIO(file_rename_failed_alert, 8);
TORRENT_DEFINE_ALERT_PRIO(file_rename_failed_alert, 8)
static const int static_category = alert::storage_notification;
@ -384,7 +384,7 @@ namespace libtorrent
performance_alert(aux::stack_allocator& alloc, torrent_handle const& h
, performance_warning_t w);
TORRENT_DEFINE_ALERT(performance_alert, 9);
TORRENT_DEFINE_ALERT(performance_alert, 9)
static const int static_category = alert::performance_warning;
@ -401,7 +401,7 @@ namespace libtorrent
, torrent_status::state_t st
, torrent_status::state_t prev_st);
TORRENT_DEFINE_ALERT(state_changed_alert, 10);
TORRENT_DEFINE_ALERT(state_changed_alert, 10)
static const int static_category = alert::status_notification;
@ -433,7 +433,7 @@ namespace libtorrent
, error_code const& e
, std::string const& m);
TORRENT_DEFINE_ALERT(tracker_error_alert, 11);
TORRENT_DEFINE_ALERT(tracker_error_alert, 11)
static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const;
@ -463,7 +463,7 @@ namespace libtorrent
, std::string const& u
, std::string const& m);
TORRENT_DEFINE_ALERT(tracker_warning_alert, 12);
TORRENT_DEFINE_ALERT(tracker_warning_alert, 12)
static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const;
@ -490,7 +490,7 @@ namespace libtorrent
, int comp
, std::string const& u);
TORRENT_DEFINE_ALERT(scrape_reply_alert, 13);
TORRENT_DEFINE_ALERT(scrape_reply_alert, 13)
virtual std::string message() const;
@ -515,7 +515,7 @@ namespace libtorrent
, std::string const& u
, std::string const& m);
TORRENT_DEFINE_ALERT(scrape_failed_alert, 14);
TORRENT_DEFINE_ALERT(scrape_failed_alert, 14)
static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const;
@ -549,7 +549,7 @@ namespace libtorrent
, int np
, std::string const& u);
TORRENT_DEFINE_ALERT(tracker_reply_alert, 15);
TORRENT_DEFINE_ALERT(tracker_reply_alert, 15)
virtual std::string message() const;
@ -570,7 +570,7 @@ namespace libtorrent
, torrent_handle const& h
, int np);
TORRENT_DEFINE_ALERT(dht_reply_alert, 16);
TORRENT_DEFINE_ALERT(dht_reply_alert, 16)
virtual std::string message() const;
@ -587,7 +587,7 @@ namespace libtorrent
, torrent_handle const& h
, std::string const& u, int e);
TORRENT_DEFINE_ALERT(tracker_announce_alert, 17);
TORRENT_DEFINE_ALERT(tracker_announce_alert, 17)
virtual std::string message() const;
@ -608,7 +608,7 @@ namespace libtorrent
hash_failed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int index);
TORRENT_DEFINE_ALERT(hash_failed_alert, 18);
TORRENT_DEFINE_ALERT(hash_failed_alert, 18)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -624,7 +624,7 @@ namespace libtorrent
peer_ban_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_ban_alert, 19);
TORRENT_DEFINE_ALERT(peer_ban_alert, 19)
virtual std::string message() const;
};
@ -637,7 +637,7 @@ namespace libtorrent
peer_unsnubbed_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_unsnubbed_alert, 20);
TORRENT_DEFINE_ALERT(peer_unsnubbed_alert, 20)
virtual std::string message() const;
};
@ -650,7 +650,7 @@ namespace libtorrent
peer_snubbed_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_snubbed_alert, 21);
TORRENT_DEFINE_ALERT(peer_snubbed_alert, 21)
virtual std::string message() const;
};
@ -664,7 +664,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int op
, error_code const& e);
TORRENT_DEFINE_ALERT(peer_error_alert, 22);
TORRENT_DEFINE_ALERT(peer_error_alert, 22)
static const int static_category = alert::peer_notification;
virtual std::string message() const;
@ -688,7 +688,7 @@ namespace libtorrent
peer_connect_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id, int type);
TORRENT_DEFINE_ALERT(peer_connect_alert, 23);
TORRENT_DEFINE_ALERT(peer_connect_alert, 23)
static const int static_category = alert::debug_notification;
virtual std::string message() const;
@ -706,7 +706,7 @@ namespace libtorrent
, peer_id const& peer_id, operation_t op, int type, error_code const& e
, close_reason_t r);
TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24);
TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24)
static const int static_category = alert::debug_notification;
virtual std::string message() const;
@ -740,7 +740,7 @@ namespace libtorrent
, peer_id const& peer_id, peer_request const& r
, bool we_have, bool peer_interested, bool withheld);
TORRENT_DEFINE_ALERT(invalid_request_alert, 25);
TORRENT_DEFINE_ALERT(invalid_request_alert, 25)
virtual std::string message() const;
@ -768,7 +768,7 @@ namespace libtorrent
torrent_finished_alert(aux::stack_allocator& alloc,
torrent_handle h);
TORRENT_DEFINE_ALERT(torrent_finished_alert, 26);
TORRENT_DEFINE_ALERT(torrent_finished_alert, 26)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -783,7 +783,7 @@ namespace libtorrent
piece_finished_alert(aux::stack_allocator& alloc,
torrent_handle const& h, int piece_num);
TORRENT_DEFINE_ALERT(piece_finished_alert, 27);
TORRENT_DEFINE_ALERT(piece_finished_alert, 27)
static const int static_category = alert::progress_notification;
virtual std::string message() const;
@ -800,7 +800,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num);
TORRENT_DEFINE_ALERT(request_dropped_alert, 28);
TORRENT_DEFINE_ALERT(request_dropped_alert, 28)
static const int static_category = alert::progress_notification
| alert::peer_notification;
@ -818,7 +818,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num);
TORRENT_DEFINE_ALERT(block_timeout_alert, 29);
TORRENT_DEFINE_ALERT(block_timeout_alert, 29)
static const int static_category = alert::progress_notification
| alert::peer_notification;
@ -836,7 +836,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num);
TORRENT_DEFINE_ALERT(block_finished_alert, 30);
TORRENT_DEFINE_ALERT(block_finished_alert, 30)
static const int static_category = alert::progress_notification;
virtual std::string message() const;
@ -853,7 +853,7 @@ namespace libtorrent
, tcp::endpoint const& ep
, peer_id const& peer_id, int block_num, int piece_num);
TORRENT_DEFINE_ALERT(block_downloading_alert, 31);
TORRENT_DEFINE_ALERT(block_downloading_alert, 31)
static const int static_category = alert::progress_notification;
virtual std::string message() const;
@ -874,7 +874,7 @@ namespace libtorrent
, tcp::endpoint const& ep
, peer_id const& peer_id, int block_num, int piece_num);
TORRENT_DEFINE_ALERT(unwanted_block_alert, 32);
TORRENT_DEFINE_ALERT(unwanted_block_alert, 32)
virtual std::string message() const;
@ -892,7 +892,7 @@ namespace libtorrent
storage_moved_alert(aux::stack_allocator& alloc
, torrent_handle const& h, std::string const& p);
TORRENT_DEFINE_ALERT(storage_moved_alert, 33);
TORRENT_DEFINE_ALERT(storage_moved_alert, 33)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -919,7 +919,7 @@ namespace libtorrent
, std::string const& file
, char const* op);
TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34);
TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -956,7 +956,7 @@ namespace libtorrent
torrent_deleted_alert(aux::stack_allocator& alloc
, torrent_handle const& h, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_deleted_alert, 35);
TORRENT_DEFINE_ALERT_PRIO(torrent_deleted_alert, 35)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -976,7 +976,7 @@ namespace libtorrent
torrent_delete_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& e, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_delete_failed_alert, 36);
TORRENT_DEFINE_ALERT_PRIO(torrent_delete_failed_alert, 36)
static const int static_category = alert::storage_notification
| alert::error_notification;
@ -1006,7 +1006,7 @@ namespace libtorrent
, boost::shared_ptr<entry> const& rd
, torrent_handle const& h);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_alert, 37);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_alert, 37)
static const int static_category = alert::storage_notification;
virtual std::string message() const;
@ -1027,7 +1027,7 @@ namespace libtorrent
save_resume_data_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& e);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_failed_alert, 38);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_failed_alert, 38)
static const int static_category = alert::storage_notification
| alert::error_notification;
@ -1053,7 +1053,7 @@ namespace libtorrent
// internal
torrent_paused_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_paused_alert, 39);
TORRENT_DEFINE_ALERT(torrent_paused_alert, 39)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1066,7 +1066,7 @@ namespace libtorrent
// internal
torrent_resumed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40);
TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1079,7 +1079,7 @@ namespace libtorrent
// internal
torrent_checked_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_checked_alert, 41);
TORRENT_DEFINE_ALERT(torrent_checked_alert, 41)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1094,7 +1094,7 @@ namespace libtorrent
url_seed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, std::string const& u, std::string const& m);
TORRENT_DEFINE_ALERT(url_seed_alert, 42);
TORRENT_DEFINE_ALERT(url_seed_alert, 42)
static const int static_category = alert::peer_notification | alert::error_notification;
std::string message() const;
@ -1134,7 +1134,7 @@ namespace libtorrent
, char const* op
, torrent_handle const& h);
TORRENT_DEFINE_ALERT(file_error_alert, 43);
TORRENT_DEFINE_ALERT(file_error_alert, 43)
static const int static_category = alert::status_notification
| alert::error_notification
@ -1170,7 +1170,7 @@ namespace libtorrent
metadata_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& ec);
TORRENT_DEFINE_ALERT(metadata_failed_alert, 44);
TORRENT_DEFINE_ALERT(metadata_failed_alert, 44)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -1210,7 +1210,7 @@ namespace libtorrent
metadata_received_alert(aux::stack_allocator& alloc
, torrent_handle const& h);
TORRENT_DEFINE_ALERT(metadata_received_alert, 45);
TORRENT_DEFINE_ALERT(metadata_received_alert, 45)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1227,7 +1227,7 @@ namespace libtorrent
, udp::endpoint const& ep
, error_code const& ec);
TORRENT_DEFINE_ALERT(udp_error_alert, 46);
TORRENT_DEFINE_ALERT(udp_error_alert, 46)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -1248,7 +1248,7 @@ namespace libtorrent
// internal
external_ip_alert(aux::stack_allocator& alloc, address const& ip);
TORRENT_DEFINE_ALERT(external_ip_alert, 47);
TORRENT_DEFINE_ALERT(external_ip_alert, 47)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1278,7 +1278,7 @@ namespace libtorrent
, error_code const& ec
, socket_type_t t);
TORRENT_DEFINE_ALERT_PRIO(listen_failed_alert, 48);
TORRENT_DEFINE_ALERT_PRIO(listen_failed_alert, 48)
static const int static_category = alert::status_notification | alert::error_notification;
virtual std::string message() const;
@ -1321,7 +1321,7 @@ namespace libtorrent
listen_succeeded_alert(aux::stack_allocator& alloc, tcp::endpoint const& ep
, socket_type_t t);
TORRENT_DEFINE_ALERT_PRIO(listen_succeeded_alert, 49);
TORRENT_DEFINE_ALERT_PRIO(listen_succeeded_alert, 49)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1349,7 +1349,7 @@ namespace libtorrent
portmap_error_alert(aux::stack_allocator& alloc, int i, int t
, error_code const& e);
TORRENT_DEFINE_ALERT(portmap_error_alert, 50);
TORRENT_DEFINE_ALERT(portmap_error_alert, 50)
static const int static_category = alert::port_mapping_notification
| alert::error_notification;
@ -1378,7 +1378,7 @@ namespace libtorrent
// internal
portmap_alert(aux::stack_allocator& alloc, int i, int port, int t);
TORRENT_DEFINE_ALERT(portmap_alert, 51);
TORRENT_DEFINE_ALERT(portmap_alert, 51)
static const int static_category = alert::port_mapping_notification;
virtual std::string message() const;
@ -1403,7 +1403,7 @@ namespace libtorrent
// internal
portmap_log_alert(aux::stack_allocator& alloc, int t, const char* m);
TORRENT_DEFINE_ALERT(portmap_log_alert, 52);
TORRENT_DEFINE_ALERT(portmap_log_alert, 52)
static const int static_category = alert::port_mapping_notification;
virtual std::string message() const;
@ -1437,7 +1437,7 @@ namespace libtorrent
, std::string const& file
, char const* op);
TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53);
TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53)
static const int static_category = alert::status_notification
| alert::error_notification;
@ -1478,7 +1478,7 @@ namespace libtorrent
peer_blocked_alert(aux::stack_allocator& alloc, torrent_handle const& h
, address const& i, int r);
TORRENT_DEFINE_ALERT(peer_blocked_alert, 54);
TORRENT_DEFINE_ALERT(peer_blocked_alert, 54)
static const int static_category = alert::ip_block_notification;
virtual std::string message() const;
@ -1508,7 +1508,7 @@ namespace libtorrent
dht_announce_alert(aux::stack_allocator& alloc, address const& i, int p
, sha1_hash const& ih);
TORRENT_DEFINE_ALERT(dht_announce_alert, 55);
TORRENT_DEFINE_ALERT(dht_announce_alert, 55)
static const int static_category = alert::dht_notification;
virtual std::string message() const;
@ -1525,7 +1525,7 @@ namespace libtorrent
// internal
dht_get_peers_alert(aux::stack_allocator& alloc, sha1_hash const& ih);
TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56);
TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56)
static const int static_category = alert::dht_notification;
virtual std::string message() const;
@ -1542,7 +1542,7 @@ namespace libtorrent
stats_alert(aux::stack_allocator& alloc, torrent_handle const& h, int interval
, stat const& s);
TORRENT_DEFINE_ALERT(stats_alert, 57);
TORRENT_DEFINE_ALERT(stats_alert, 57)
static const int static_category = alert::stats_notification;
virtual std::string message() const;
@ -1593,7 +1593,7 @@ namespace libtorrent
// internal
cache_flushed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(cache_flushed_alert, 58);
TORRENT_DEFINE_ALERT(cache_flushed_alert, 58)
static const int static_category = alert::storage_notification;
};
@ -1608,7 +1608,7 @@ namespace libtorrent
anonymous_mode_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int k, std::string const& s);
TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59);
TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -1634,7 +1634,7 @@ namespace libtorrent
lsd_peer_alert(aux::stack_allocator& alloc, torrent_handle const& h
, tcp::endpoint const& i);
TORRENT_DEFINE_ALERT(lsd_peer_alert, 60);
TORRENT_DEFINE_ALERT(lsd_peer_alert, 60)
static const int static_category = alert::peer_notification;
virtual std::string message() const;
@ -1650,7 +1650,7 @@ namespace libtorrent
, std::string const& u
, const std::string& id);
TORRENT_DEFINE_ALERT(trackerid_alert, 61);
TORRENT_DEFINE_ALERT(trackerid_alert, 61)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1673,7 +1673,7 @@ namespace libtorrent
// internal
dht_bootstrap_alert(aux::stack_allocator& alloc);
TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62);
TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62)
static const int static_category = alert::dht_notification;
virtual std::string message() const;
@ -1691,7 +1691,7 @@ namespace libtorrent
rss_alert(aux::stack_allocator& alloc, feed_handle h
, std::string const& u, int s, error_code const& ec);
TORRENT_DEFINE_ALERT(rss_alert, 63);
TORRENT_DEFINE_ALERT(rss_alert, 63)
static const int static_category = alert::rss_notification;
virtual std::string message() const;
@ -1734,7 +1734,7 @@ namespace libtorrent
torrent_error_alert(aux::stack_allocator& alloc, torrent_handle const& h
, error_code const& e, std::string const& f);
TORRENT_DEFINE_ALERT(torrent_error_alert, 64);
TORRENT_DEFINE_ALERT(torrent_error_alert, 64)
static const int static_category = alert::error_notification | alert::status_notification;
virtual std::string message() const;
@ -1764,7 +1764,7 @@ namespace libtorrent
torrent_need_cert_alert(aux::stack_allocator& alloc
, torrent_handle const& h);
TORRENT_DEFINE_ALERT_PRIO(torrent_need_cert_alert, 65);
TORRENT_DEFINE_ALERT_PRIO(torrent_need_cert_alert, 65)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1787,7 +1787,7 @@ namespace libtorrent
incoming_connection_alert(aux::stack_allocator& alloc, int t
, tcp::endpoint const& i);
TORRENT_DEFINE_ALERT(incoming_connection_alert, 66);
TORRENT_DEFINE_ALERT(incoming_connection_alert, 66)
static const int static_category = alert::peer_notification;
virtual std::string message() const;
@ -1849,7 +1849,7 @@ namespace libtorrent
: status(st)
{}
TORRENT_DEFINE_ALERT_PRIO(state_update_alert, 68);
TORRENT_DEFINE_ALERT_PRIO(state_update_alert, 68)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1869,7 +1869,7 @@ namespace libtorrent
{
mmap_cache_alert(aux::stack_allocator& alloc
, error_code const& ec): error(ec) {}
TORRENT_DEFINE_ALERT(mmap_cache_alert, 69);
TORRENT_DEFINE_ALERT(mmap_cache_alert, 69)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -1884,7 +1884,7 @@ namespace libtorrent
struct TORRENT_EXPORT session_stats_alert : alert
{
session_stats_alert(aux::stack_allocator& alloc, counters const& cnt);
TORRENT_DEFINE_ALERT_PRIO(session_stats_alert, 70);
TORRENT_DEFINE_ALERT_PRIO(session_stats_alert, 70)
static const int static_category = alert::stats_notification;
virtual std::string message() const;
@ -1917,7 +1917,7 @@ namespace libtorrent
torrent_update_alert(aux::stack_allocator& alloc, torrent_handle h
, sha1_hash const& old_hash, sha1_hash const& new_hash);
TORRENT_DEFINE_ALERT_PRIO(torrent_update_alert, 71);
TORRENT_DEFINE_ALERT_PRIO(torrent_update_alert, 71)
static const int static_category = alert::status_notification;
virtual std::string message() const;
@ -1942,7 +1942,7 @@ namespace libtorrent
rss_item_alert(aux::stack_allocator& alloc, feed_handle h
, feed_item const& item);
TORRENT_DEFINE_ALERT(rss_item_alert, 72);
TORRENT_DEFINE_ALERT(rss_item_alert, 72)
static const int static_category = alert::rss_notification;
virtual std::string message() const;
@ -1959,7 +1959,7 @@ namespace libtorrent
// internal
dht_error_alert(aux::stack_allocator& alloc, int op, error_code const& ec);
TORRENT_DEFINE_ALERT(dht_error_alert, 73);
TORRENT_DEFINE_ALERT(dht_error_alert, 73)
static const int static_category = alert::error_notification
| alert::dht_notification;
@ -1985,7 +1985,7 @@ namespace libtorrent
dht_immutable_item_alert(aux::stack_allocator& alloc, sha1_hash const& t
, entry const& i);
TORRENT_DEFINE_ALERT_PRIO(dht_immutable_item_alert, 74);
TORRENT_DEFINE_ALERT_PRIO(dht_immutable_item_alert, 74)
static const int static_category = alert::error_notification
| alert::dht_notification;
@ -2014,7 +2014,7 @@ namespace libtorrent
, std::string const& s
, entry const& i);
TORRENT_DEFINE_ALERT_PRIO(dht_mutable_item_alert, 75);
TORRENT_DEFINE_ALERT_PRIO(dht_mutable_item_alert, 75)
static const int static_category = alert::error_notification
| alert::dht_notification;
@ -2055,7 +2055,7 @@ namespace libtorrent
, std::string s
, boost::uint64_t sequence_number);
TORRENT_DEFINE_ALERT(dht_put_alert, 76);
TORRENT_DEFINE_ALERT(dht_put_alert, 76)
static const int static_category = alert::dht_notification;
virtual std::string message() const;
@ -2077,7 +2077,7 @@ namespace libtorrent
{
i2p_alert(aux::stack_allocator& alloc, error_code const& ec);
TORRENT_DEFINE_ALERT(i2p_alert, 77);
TORRENT_DEFINE_ALERT(i2p_alert, 77)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -2099,7 +2099,7 @@ namespace libtorrent
, ip(ep)
{}
TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78);
TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78)
static const int static_category = alert::dht_notification;
virtual std::string message() const;
@ -2124,7 +2124,7 @@ namespace libtorrent
// internal
log_alert(aux::stack_allocator& alloc, char const* log);
TORRENT_DEFINE_ALERT(log_alert, 79);
TORRENT_DEFINE_ALERT(log_alert, 79)
static const int static_category = alert::session_log_notification;
virtual std::string message() const;
@ -2147,7 +2147,7 @@ namespace libtorrent
torrent_log_alert(aux::stack_allocator& alloc, torrent_handle h
, char const* log);
TORRENT_DEFINE_ALERT(torrent_log_alert, 80);
TORRENT_DEFINE_ALERT(torrent_log_alert, 80)
static const int static_category = alert::torrent_log_notification;
virtual std::string message() const;
@ -2170,7 +2170,7 @@ namespace libtorrent
, tcp::endpoint const& i
, peer_id const& pi, char const* log);
TORRENT_DEFINE_ALERT(peer_log_alert, 81);
TORRENT_DEFINE_ALERT(peer_log_alert, 81)
static const int static_category = alert::peer_log_notification;
virtual std::string message() const;
@ -2192,7 +2192,7 @@ namespace libtorrent
, error(ec)
{}
TORRENT_DEFINE_ALERT(lsd_error_alert, 82);
TORRENT_DEFINE_ALERT(lsd_error_alert, 82)
static const int static_category = alert::error_notification;
virtual std::string message() const;
@ -2270,7 +2270,7 @@ namespace libtorrent
, routing_table(table)
{}
TORRENT_DEFINE_ALERT(dht_stats_alert, 83);
TORRENT_DEFINE_ALERT(dht_stats_alert, 83)
static const int static_category = alert::stats_notification;
virtual std::string message() const;

View File

@ -43,7 +43,7 @@ namespace libtorrent
struct TORRENT_EXTRA_EXPORT page_aligned_allocator
{
typedef std::size_t size_type;
typedef int size_type;
typedef std::ptrdiff_t difference_type;
static char* malloc(const size_type bytes);

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \
#if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \
|| defined TORRENT_ASIO_DEBUGGING \
|| defined TORRENT_PROFILE_CALLS \
|| TORRENT_RELEASE_ASSERTS \
@ -47,11 +47,11 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0);
#if TORRENT_USE_ASSERTS
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
extern char const* libtorrent_assert_log;
#endif
#if !TORRENT_USE_SYSTEM_ASSERT
#ifndef TORRENT_USE_SYSTEM_ASSERTS
#if TORRENT_USE_IOSTREAM
#include <sstream>
@ -59,8 +59,8 @@ extern char const* libtorrent_assert_log;
TORRENT_EXPORT void assert_print(char const* fmt, ...);
TORRENT_EXPORT void assert_fail(const char* expr, int line, char const* file
, char const* function, char const* val, int kind = 0);
TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(const char* expr, int line
, char const* file, char const* function, char const* val, int kind = 0);
#define TORRENT_ASSERT_PRECOND(x) \
do { if (x) {} else assert_fail(#x, __LINE__, __FILE__, TORRENT_FUNCTION, 0, 1); } while (false)

View File

@ -0,0 +1,40 @@
/*
Copyright (c) 2015, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif

View File

@ -0,0 +1,69 @@
/*
Copyright (c) 2015, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wswitch-enum"
#pragma GCC diagnostic ignored "-Wcovered-switch-default"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wweak-vtables"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wshadow"
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wswitch-enum"
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wcast-align"
#pragma clang diagnostic ignored "-Wweak-vtable"
#pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wshadow"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif

View File

@ -33,12 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SESSION_IMPL_HPP_INCLUDED
#define TORRENT_SESSION_IMPL_HPP_INCLUDED
#include <algorithm>
#include <vector>
#include <set>
#include <list>
#include <stdarg.h> // for va_start, va_end
#include "libtorrent/config.hpp"
#include "libtorrent/aux_/session_settings.hpp"
#include "libtorrent/aux_/session_interface.hpp"
@ -48,18 +42,24 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/torrent_peer_allocator.hpp"
#include "libtorrent/performance_counters.hpp" // for counters
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <algorithm>
#include <vector>
#include <set>
#include <list>
#include <stdarg.h> // for va_start, va_end
#if TORRENT_HAS_BOOST_UNORDERED
#include <boost/unordered_map.hpp>
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/session.hpp" // for user_load_function_t
#include "libtorrent/ip_voter.hpp"
#include "libtorrent/torrent_handle.hpp"
@ -100,10 +100,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/peer_connection.hpp"
#endif
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent
{

View File

@ -35,17 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#include "libtorrent/peer_id.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/weak_ptr.hpp>
#include <boost/function.hpp>
#include "libtorrent/address.hpp"
#include "libtorrent/io_service.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#ifndef TORRENT_DISABLE_DHT
#include "libtorrent/socket.hpp"
#endif
#ifndef TORRENT_DISABLE_LOGGING
#include <boost/shared_ptr.hpp>
#endif
@ -54,6 +49,16 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/ssl/context.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/io_service.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#ifndef TORRENT_DISABLE_DHT
#include "libtorrent/socket.hpp"
#endif
#include "libtorrent/socket.hpp" // for tcp::endpoint
namespace libtorrent

View File

@ -33,8 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED
#define TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#ifdef TORRENT_VERBOSE_BANDWIDTH_LIMIT
#include <fstream>
#endif

View File

@ -33,7 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED
#define TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/bandwidth_limit.hpp"
#include "libtorrent/bandwidth_socket.hpp"

View File

@ -30,10 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <boost/system/error_code.hpp>
#include <vector>
#include <string>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/assert.hpp"
#ifndef TORRENT_BDECODE_HPP

View File

@ -76,15 +76,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <exception>
#include <iterator> // for distance
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/static_assert.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/entry.hpp"
#include "libtorrent/config.hpp"

View File

@ -85,7 +85,7 @@ namespace libtorrent
resize(bits);
if (bits > 0)
{
std::memcpy(m_buf, b, ((bits + 7) / 8));
std::memcpy(m_buf, b, size_t((bits + 7) / 8));
clear_trailing_bits();
}
}
@ -143,7 +143,7 @@ namespace libtorrent
// returns the size of the bitfield in bits.
int size() const
{
return m_buf == NULL ? 0 : m_buf[-1];
return m_buf == NULL ? 0 : int(m_buf[-1]);
}
int num_words() const
@ -156,7 +156,7 @@ namespace libtorrent
// returns a pointer to the internal buffer of the bitfield.
// TODO: rename to data() ?
char const* bytes() const { return (char const*)m_buf; }
char const* bytes() const { return reinterpret_cast<char const*>(m_buf); }
// copy operator
bitfield& operator=(bitfield const& rhs)
@ -287,13 +287,15 @@ namespace libtorrent
{
if (old_size_words && b) m_buf[old_size_words - 1] |= htonl((0xffffffff >> b));
if (old_size_words < new_size_words)
std::memset(m_buf + old_size_words, 0xff, (new_size_words - old_size_words) * 4);
std::memset(m_buf + old_size_words, 0xff
, size_t((new_size_words - old_size_words) * 4));
clear_trailing_bits();
}
else
{
if (old_size_words < new_size_words)
std::memset(m_buf + old_size_words, 0x00, (new_size_words - old_size_words) * 4);
std::memset(m_buf + old_size_words, 0x00
, size_t((new_size_words - old_size_words) * 4));
}
TORRENT_ASSERT(size() == bits);
}
@ -329,12 +331,12 @@ namespace libtorrent
// set all bits in the bitfield to 1 (set_all) or 0 (clear_all).
void set_all()
{
std::memset(m_buf, 0xff, num_words() * 4);
std::memset(m_buf, 0xff, size_t(num_words() * 4));
clear_trailing_bits();
}
void clear_all()
{
std::memset(m_buf, 0x00, num_words() * 4);
std::memset(m_buf, 0x00, size_t(num_words() * 4));
}
// make the bitfield empty, of zero size.

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BLOCK_CACHE
#define TORRENT_BLOCK_CACHE
#include "aux_/disable_warnings_push.hpp"
#include <boost/unordered_set.hpp>
#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
@ -40,6 +42,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list>
#include <vector>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/time.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/io_service_fwd.hpp"

View File

@ -33,12 +33,16 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BLOOM_FILTER_HPP_INCLUDED
#define TORRENT_BLOOM_FILTER_HPP_INCLUDED
#include <boost/cstdint.hpp>
#include "libtorrent/peer_id.hpp" // for sha1_hash
#include "libtorrent/config.hpp" // for sha1_hash
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <math.h> // for log()
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
TORRENT_EXTRA_EXPORT void set_bits(boost::uint8_t const* b, boost::uint8_t* bits, int len);

View File

@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp"
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/smart_ptr.hpp>
#include <boost/noncopyable.hpp>
@ -51,9 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/buffer.hpp"
#include "libtorrent/peer_connection.hpp"

View File

@ -389,6 +389,12 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#include <limits.h>
#endif
#if defined __cplusplus && __cplusplus >= 199711L
#define TORRENT_NO_RETURN [[noreturn]]
#else
#define TORRENT_NO_RETURN
#endif
#ifndef TORRENT_ICONV_ARG
#define TORRENT_ICONV_ARG (char**)
#endif
@ -442,6 +448,14 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#define TORRENT_HAS_SEM_RELTIMEDWAIT 0
#endif
#ifndef TORRENT_USE_MEMALIGN
#define TORRENT_USE_MEMALIGN 0
#endif
#ifndef TORRENT_USE_POSIX_MEMALIGN
#define TORRENT_USE_POSIX_MEMALIGN 0
#endif
#ifndef TORRENT_USE_LOCALE
#define TORRENT_USE_LOCALE 0
#endif
@ -525,7 +539,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#endif
#ifndef TORRENT_THREADSAFE_STATIC
#if __cplusplus < 199711L || _MSC_VER <= 1800
#if __cplusplus < 199711L || (defined _MSC_VER && _MSC_VER <= 1800)
#define TORRENT_THREADSAFE_STATIC 0
#else
#define TORRENT_THREADSAFE_STATIC 1
@ -592,6 +606,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#define TORRENT_FUNCTION __FUNCTION__
#endif
// debug builds have asserts enabled by default, release
// builds have asserts if they are explicitly enabled by
// the release_asserts macro.
@ -603,7 +618,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#endif
#endif // TORRENT_USE_ASSERTS
#if defined TORRENT_DEBUG && TORRENT_USE_ASSERTS \
#if defined TORRENT_DEBUG && defined TORRENT_USE_ASSERTS \
&& !defined TORRENT_DISABLE_INVARIANT_CHECKS
#define TORRENT_USE_INVARIANT_CHECKS 1
#else

View File

@ -43,20 +43,16 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/allocator.hpp"
#include "libtorrent/file.hpp" // for combine_path etc.
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <string>
#include <utility>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/scoped_ptr.hpp>
#include <boost/config.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
// OVERVIEW
//

View File

@ -33,25 +33,30 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISK_BUFFER_POOL_HPP
#define TORRENT_DISK_BUFFER_POOL_HPP
#include <boost/utility.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/thread.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/file.hpp" // for iovec_t
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
#include <set>
#endif
#include <boost/utility.hpp>
#ifndef TORRENT_DISABLE_POOL_ALLOCATOR
#include "libtorrent/allocator.hpp" // for page_aligned_allocator
#include <boost/pool/pool.hpp>
#endif
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
#include <set>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/thread.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/file.hpp" // for iovec_t
namespace libtorrent
{
namespace aux { struct session_settings; }

View File

@ -33,15 +33,20 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISK_IO_JOB_HPP
#define TORRENT_DISK_IO_JOB_HPP
#include <string>
#include "libtorrent/time.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/tailqueue.hpp"
#include "libtorrent/peer_id.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <string>
#include <boost/function/function1.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
class entry;

View File

@ -35,8 +35,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#include "libtorrent/thread.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/pool/object_pool.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
struct disk_io_job;

View File

@ -303,7 +303,7 @@ namespace libtorrent
#ifndef BOOST_NO_EXCEPTIONS
// internal
inline void throw_type_error()
TORRENT_NO_RETURN inline void throw_type_error()
{
throw libtorrent_exception(error_code(errors::invalid_entry_type
, get_libtorrent_category()));

View File

@ -34,16 +34,22 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_ENUM_NET_HPP_INCLUDED
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <boost/asio/ip/tcp.hpp>
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/error_code.hpp"
#if TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL
#include <sys/socket.h> // for SO_BINDTODEVICE
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/error_code.hpp"
namespace libtorrent
{
struct socket_type;

View File

@ -35,6 +35,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/version.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/string_util.hpp" // for allocate_string_copy
#include <stdlib.h> // free
#include "libtorrent/aux_/disable_warnings_push.hpp"
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
// asio assumes that the windows error codes are defined already
@ -47,8 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/system/error_code.hpp>
#endif
#include "libtorrent/string_util.hpp" // for allocate_string_copy
#include <stdlib.h> // free
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#ifndef BOOST_SYSTEM_NOEXCEPT
#define BOOST_SYSTEM_NOEXCEPT throw()
@ -59,8 +62,10 @@ namespace libtorrent
namespace errors
{
// libtorrent uses boost.system's ``error_code`` class to represent errors. libtorrent has
// its own error category get_libtorrent_category() whith the error codes defined by error_code_enum.
// libtorrent uses boost.system's ``error_code`` class to represent
// errors. libtorrent has its own error category
// get_libtorrent_category() whith the error codes defined by
// error_code_enum.
enum error_code_enum
{
// Not an error
@ -535,8 +540,8 @@ namespace libtorrent
struct TORRENT_EXPORT libtorrent_exception: std::exception
{
libtorrent_exception(error_code const& s): m_error(s), m_msg(0) {}
virtual const char* what() const throw();
virtual ~libtorrent_exception() throw();
virtual const char* what() const BOOST_SYSTEM_NOEXCEPT;
virtual ~libtorrent_exception() BOOST_SYSTEM_NOEXCEPT;
error_code error() const { return m_error; }
private:
error_code m_error;
@ -619,6 +624,9 @@ namespace boost { namespace system {
#endif // BOOST_VERSION
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

View File

@ -69,7 +69,7 @@ POSSIBILITY OF SUCH DAMAGE.
// when this is specified, export a bunch of extra
// symbols, mostly for the unit tests to reach
#if TORRENT_EXPORT_EXTRA
#if defined TORRENT_EXPORT_EXTRA
# if defined TORRENT_BUILDING_SHARED
# define TORRENT_EXTRA_EXPORT BOOST_SYMBOL_EXPORT
# elif defined TORRENT_LINKING_SHARED

View File

@ -165,15 +165,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/weak_ptr.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include <vector>
#include "libtorrent/config.hpp"

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -35,16 +35,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#ifndef TORRENT_NO_DEPRECATE

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -36,21 +36,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include <memory>
#include <string>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/noncopyable.hpp>
#include <boost/smart_ptr.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
#include <boost/function.hpp>
#ifdef TORRENT_WINDOWS
// windows part
@ -82,7 +74,11 @@ POSSIBILITY OF SUCH DAMAGE.
#endif
#include <boost/function.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
namespace libtorrent
{
@ -206,7 +202,7 @@ namespace libtorrent
struct file;
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
struct file_handle
{
file_handle();
@ -338,7 +334,7 @@ namespace libtorrent
boost::uint32_t file_id() const { return m_file_id; }
#endif
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
void print_info(FILE* out) const;
#endif
@ -365,7 +361,7 @@ namespace libtorrent
static bool has_manage_volume_privs;
#endif
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
std::string m_file_path;
#endif
};

View File

@ -33,12 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_FILE_STORAGE_HPP_INCLUDED
#define TORRENT_FILE_STORAGE_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <string>
#include <vector>
#include <ctime>
#include <boost/cstdint.hpp>
#include <boost/unordered_set.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/peer_request.hpp"
#include "libtorrent/peer_id.hpp"

View File

@ -115,8 +115,8 @@ namespace libtorrent
char version_to_char(int v) const
{
if (v >= 0 && v < 10) return '0' + v;
else if (v >= 10) return 'A' + (v - 10);
if (v >= 0 && v < 10) return char('0' + v);
else if (v >= 10) return char('A' + (v - 10));
TORRENT_ASSERT(false);
return '0';
}

View File

@ -69,7 +69,7 @@ namespace libtorrent {
uintptr_t* ptr = m_storage + m_size;
// length prefix
header_t* hdr = (header_t*)ptr;
header_t* hdr = reinterpret_cast<header_t*>(ptr);
hdr->len = object_size;
hdr->move = &move<U>;
ptr += header_size;
@ -91,10 +91,10 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size;
while (ptr < end)
{
header_t* hdr = (header_t*)ptr;
header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size;
TORRENT_ASSERT(ptr + hdr->len <= end);
out.push_back((T*)ptr);
out.push_back(reinterpret_cast<T*>(ptr));
ptr += hdr->len;
}
}
@ -116,10 +116,10 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size;
while (ptr < end)
{
header_t* hdr = (header_t*)ptr;
header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size;
TORRENT_ASSERT(ptr + hdr->len <= end);
T* a = (T*)ptr;
T* a = reinterpret_cast<T*>(ptr);
a->~T();
ptr += hdr->len;
}
@ -133,10 +133,10 @@ namespace libtorrent {
TORRENT_ASSERT(m_size > 1);
uintptr_t* ptr = m_storage;
header_t* hdr = (header_t*)ptr;
header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size;
TORRENT_ASSERT(hdr->len <= m_size);
return (T*)ptr;
return reinterpret_cast<T*>(ptr);
}
~heterogeneous_queue()
@ -176,8 +176,8 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size;
while (src < end)
{
header_t* src_hdr = (header_t*)src;
header_t* dst_hdr = (header_t*)dst;
header_t* src_hdr = reinterpret_cast<header_t*>(src);
header_t* dst_hdr = reinterpret_cast<header_t*>(dst);
*dst_hdr = *src_hdr;
src += header_size;
dst += header_size;
@ -196,7 +196,7 @@ namespace libtorrent {
template <class U>
static void move(uintptr_t* dst, uintptr_t* src)
{
U* rhs = (U*)src;
U* rhs = reinterpret_cast<U*>(src);
#if __cplusplus >= 201103L
new (dst) U(std::move(*rhs));
#else

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_HTTP_CONNECTION
#define TORRENT_HTTP_CONNECTION
#include "aux_/disable_warnings_push.hpp"
#include <boost/function/function1.hpp>
#include <boost/function/function2.hpp>
#include <boost/function/function5.hpp>
@ -43,6 +45,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <string>
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/socket.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/http_parser.hpp"
@ -53,10 +61,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/i2p_stream.hpp"
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent
{

View File

@ -38,16 +38,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <utility>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/buffer.hpp"

View File

@ -40,9 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp"
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp>
@ -51,9 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/web_connection_base.hpp"

View File

@ -33,12 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_HTTP_STREAM_HPP_INCLUDED
#define TORRENT_HTTP_STREAM_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/function/function1.hpp>
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/string_util.hpp"
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/string_util.hpp"
namespace libtorrent {
class http_stream : public proxy_base

View File

@ -36,15 +36,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/lazy_entry.hpp"

View File

@ -37,6 +37,8 @@ POSSIBILITY OF SUCH DAMAGE.
#if TORRENT_USE_I2P
#include "aux_/disable_warnings_push.hpp"
#include <list>
#include <string>
#include <vector>
@ -44,6 +46,9 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/function/function2.hpp>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/string_util.hpp"

View File

@ -33,15 +33,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED
#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/optional.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/fingerprint.hpp"

View File

@ -51,7 +51,7 @@ namespace libtorrent
inline T read_impl(InIt& start, type<T>)
{
T ret = 0;
for (int i = 0; i < (int)sizeof(T); ++i)
for (int i = 0; i < int(sizeof(T)); ++i)
{
ret <<= 8;
ret |= static_cast<boost::uint8_t>(*start);
@ -75,7 +75,7 @@ namespace libtorrent
template <class T, class OutIt>
inline void write_impl(T val, OutIt& start)
{
for (int i = (int)sizeof(T)-1; i >= 0; --i)
for (int i = int(sizeof(T))-1; i >= 0; --i)
{
*start = static_cast<unsigned char>((val >> (i * 8)) & 0xff);
++start;
@ -151,7 +151,7 @@ namespace libtorrent
inline int write_string(std::string const& str, char*& start)
{
std::memcpy((void*)start, str.c_str(), str.size());
std::memcpy(reinterpret_cast<void*>(start), str.c_str(), str.size());
start += str.size();
return str.size();
}

View File

@ -37,9 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define Protocol Protocol_
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/version.hpp>
@ -54,9 +52,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/io_service.hpp>
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#ifdef __OBJC__
#undef Protocol

View File

@ -37,15 +37,11 @@ POSSIBILITY OF SUCH DAMAGE.
#define Protocol Protocol_
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/version.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#ifdef __OBJC__
#undef Protocol

View File

@ -36,19 +36,14 @@ POSSIBILITY OF SUCH DAMAGE.
#include <set>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/limits.hpp>
#include <boost/utility.hpp>
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/address.hpp"

View File

@ -33,23 +33,26 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef ROUTING_TABLE_HPP
#define ROUTING_TABLE_HPP
#include <vector>
#include <boost/cstdint.hpp>
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <set>
#include <boost/cstdint.hpp>
#include <boost/utility.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/array.hpp>
#include <boost/noncopyable.hpp>
#include <set>
#include <boost/unordered_set.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include <libtorrent/kademlia/logging.hpp>
#include <libtorrent/kademlia/node_id.hpp>
#include <libtorrent/kademlia/node_entry.hpp>
#include <libtorrent/session_settings.hpp>
#include <libtorrent/assert.hpp>
#include <libtorrent/time.hpp>
#include <boost/unordered_set.hpp>
namespace libtorrent
{

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef RPC_MANAGER_HPP
#define RPC_MANAGER_HPP
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <deque>
#include <map>
@ -46,6 +48,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <multimap>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include <libtorrent/socket.hpp>
#include <libtorrent/entry.hpp>
#include <libtorrent/kademlia/node_id.hpp>

View File

@ -33,15 +33,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PARSE_URL_HPP_INCLUDED
#define TORRENT_PARSE_URL_HPP_INCLUDED
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include <string>
#include "libtorrent/config.hpp"

View File

@ -30,10 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <string>
#include <vector>
#include <boost/unordered_map.hpp>
#include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/error_code.hpp"

View File

@ -36,11 +36,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/bandwidth_limit.hpp"
#include "libtorrent/assert.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <string>
#include <boost/smart_ptr.hpp>
#include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
typedef boost::uint8_t peer_class_t;

View File

@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp>
@ -55,9 +53,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/pool/pool.hpp>
#include <boost/aligned_storage.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/buffer.hpp"
#include "libtorrent/peer_id.hpp"

View File

@ -33,8 +33,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED
#define TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <boost/atomic.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
namespace libtorrent

View File

@ -32,34 +32,25 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PIECE_PICKER_HPP_INCLUDED
#define TORRENT_PIECE_PICKER_HPP_INCLUDED
#include <algorithm>
#include <vector>
#include <bitset>
#include <utility>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
// this is really only useful for debugging unit tests
//#define TORRENT_PICKER_LOG
// heavy weight reference counting invariant checks
//#define TORRENT_DEBUG_REFCOUNTS
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <algorithm>
#include <vector>
#include <bitset>
#include <utility>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef TORRENT_DEBUG_REFCOUNTS
#include <set>
#endif
@ -68,6 +59,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <set>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
namespace libtorrent
{
@ -499,10 +496,10 @@ namespace libtorrent
{
piece_pos() {}
piece_pos(int peer_count_, int index_)
: peer_count(peer_count_)
: peer_count(unsigned(peer_count_))
, download_state(piece_pos::piece_open)
, piece_priority(4)
, index(index_)
, index(unsigned(index_))
{
TORRENT_ASSERT(peer_count_ >= 0);
TORRENT_ASSERT(index_ >= 0);
@ -582,7 +579,7 @@ namespace libtorrent
// the number of peers that has this piece
// (availability)
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t peer_count : 9;
#else
boost::uint32_t peer_count : 16;
@ -614,7 +611,7 @@ namespace libtorrent
boost::uint32_t piece_priority : 3;
// index in to the piece_info vector
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t index : 17;
#else
boost::uint32_t index;
@ -630,7 +627,7 @@ namespace libtorrent
// index is set to this to indicate that we have the
// piece. There is no entry for the piece in the
// buckets if this is the case.
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
we_have_index = 0x3ffff,
#else
we_have_index = 0xffffffff,
@ -638,7 +635,7 @@ namespace libtorrent
// the priority value that means the piece is filtered
filter_priority = 0,
// the max number the peer count can hold
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
max_peer_count = 0x1ff
#else
max_peer_count = 0xffff
@ -710,7 +707,7 @@ namespace libtorrent
};
#ifndef TORRENT_DEBUG_REFCOUNTS
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 4);
#else
BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 8);
@ -843,7 +840,7 @@ namespace libtorrent
mutable bool m_dirty;
public:
#if TORRENT_OPTIMIZE_MEMORY_USAGE
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
enum { max_pieces = piece_pos::we_have_index - 1 };
#else
// still limited by piece_block

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_RESOLVE_LINKS_HPP
#define TORRENT_RESOLVE_LINKS_HPP
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
#include <vector>
#include <utility>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/export.hpp"
namespace libtorrent

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_RESOLVER_HPP_INCLUDE
#define TORRENT_RESOLVER_HPP_INCLUDE
#include "aux_/disable_warnings_push.hpp"
#include <boost/asio/ip/tcp.hpp>
#include <boost/function.hpp>
#include <boost/unordered_map.hpp>
#include <vector>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/io_service.hpp"
#include "libtorrent/resolver_interface.hpp"

View File

@ -36,16 +36,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/limits.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
# include <eh.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/entry.hpp"
@ -62,10 +61,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/storage.hpp"
#include "libtorrent/session_settings.hpp"
#ifdef _MSC_VER
# include <eh.h>
#endif
#ifndef TORRENT_NO_DEPRECATE
#include "libtorrent/rss.hpp"
#endif

View File

@ -305,7 +305,7 @@ namespace libtorrent
// return a copy of the 20 bytes representing the sha1-hash as a std::string.
// It's still a binary string with 20 binary characters.
std::string to_string() const
{ return std::string((char const*)&m_number[0], size); }
{ return std::string(reinterpret_cast<char const*>(&m_number[0]), size); }
private:
@ -327,7 +327,7 @@ namespace libtorrent
inline std::ostream& operator<<(std::ostream& os, sha1_hash const& peer)
{
char out[41];
to_hex((char const*)&peer[0], sha1_hash::size, out);
to_hex(reinterpret_cast<char const*>(&peer[0]), sha1_hash::size, out);
return os << out;
}
@ -336,7 +336,7 @@ namespace libtorrent
{
char hex[40];
is.read(hex, 40);
if (!from_hex(hex, 40, (char*)&peer[0]))
if (!from_hex(hex, 40, reinterpret_cast<char*>(&peer[0])))
is.setstate(std::ios_base::failbit);
return is;
}

View File

@ -33,9 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SOCKET_HPP_INCLUDED
#define TORRENT_SOCKET_HPP_INCLUDED
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
// if building as Objective C++, asio's template
// parameters Protocol has to be renamed to avoid
@ -68,9 +66,7 @@ POSSIBILITY OF SUCH DAMAGE.
#undef Protocol
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -33,9 +33,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SOCKS5_STREAM_HPP_INCLUDED
#define TORRENT_SOCKS5_STREAM_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/assert.hpp"
#if defined TORRENT_ASIO_DEBUGGING

View File

@ -33,13 +33,10 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_STORAGE_HPP_INCLUDE
#define TORRENT_STORAGE_HPP_INCLUDE
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <sys/types.h>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/function/function2.hpp>
#include <boost/function/function0.hpp>
#include <boost/limits.hpp>
@ -49,10 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/unordered_set.hpp>
#include <boost/atomic.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/piece_picker.hpp"
#include "libtorrent/peer_request.hpp"

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
#include <memory>
#include "aux_/disable_warnings_push.hpp"
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
// asio assumes that the windows error codes are defined already
@ -55,6 +55,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/detail/event.hpp>
#include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
typedef boost::asio::detail::thread thread;

View File

@ -39,9 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list>
#include <deque>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/limits.hpp>
#include <boost/tuple/tuple.hpp>
@ -50,9 +48,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/shared_ptr.hpp>
#include <boost/version.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/entry.hpp"

View File

@ -33,22 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_TORRENT_HANDLE_HPP_INCLUDED
#define TORRENT_TORRENT_HANDLE_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <set>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/assert.hpp>
#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/piece_picker.hpp"
@ -1223,7 +1219,7 @@ namespace libtorrent
boost::uint32_t id() const
{
uintptr_t ret = (uintptr_t)m_torrent.lock().get();
uintptr_t ret = reinterpret_cast<uintptr_t>(m_torrent.lock().get());
// a torrent object is about 1024 bytes, so
// it's safe to shift 11 bits
return boost::uint32_t(ret >> 11);
@ -1335,6 +1331,7 @@ namespace libtorrent
// ``torrent_handle::query_torrent_file``.
boost::weak_ptr<const torrent_info> torrent_file;
// TODO: 3 don't use boost.date-time types here. use chrono types
// the time until the torrent will announce itself to the tracker.
boost::posix_time::time_duration next_announce;

View File

@ -36,16 +36,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/optional.hpp>
#include <boost/shared_array.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/entry.hpp"

View File

@ -39,9 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <utility>
#include <ctime>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
@ -50,10 +48,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/tuple/tuple.hpp>
#include <boost/unordered_map.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/socket.hpp"
#include "libtorrent/address.hpp"
@ -62,9 +62,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/deadline_timer.hpp"
#include "libtorrent/union_endpoint.hpp"
#include "libtorrent/udp_socket.hpp" // for udp_socket_observer
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent
{

View File

@ -33,21 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED
#define TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <string>
#include <utility>
#include <ctime>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/udp_socket.hpp"
#include "libtorrent/entry.hpp"

View File

@ -33,18 +33,16 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef WEB_CONNECTION_BASE_HPP_INCLUDED
#define WEB_CONNECTION_BASE_HPP_INCLUDED
#include "libtorrent/debug.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include "libtorrent/debug.hpp"
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/noncopyable.hpp>
@ -52,9 +50,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/buffer.hpp"
#include "libtorrent/peer_connection.hpp"

View File

@ -33,16 +33,14 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED
#define TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/noncopyable.hpp>
@ -50,9 +48,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/web_connection_base.hpp"

View File

@ -33,14 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_XML_PARSE_HPP
#define TORRENT_XML_PARSE_HPP
#include "aux_/disable_warnings_push.hpp"
#include <cctype>
#include <cstring>
#include <boost/function.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include <boost/function.hpp>
namespace libtorrent
{
enum

View File

@ -87,7 +87,7 @@ namespace libtorrent
#elif defined TORRENT_BEOS
s = B_PAGE_SIZE;
#else
s = sysconf(_SC_PAGESIZE);
s = int(sysconf(_SC_PAGESIZE));
#endif
// assume the page size is 4 kiB if we
// fail to query it
@ -112,18 +112,19 @@ namespace libtorrent
char* ret;
#if TORRENT_USE_POSIX_MEMALIGN
if (posix_memalign((void**)&ret, page_size(), bytes) != 0) ret = NULL;
if (posix_memalign(reinterpret_cast<void**>(&ret), page_size(), bytes)
!= 0) ret = NULL;
#elif TORRENT_USE_MEMALIGN
ret = (char*)memalign(page_size(), bytes);
ret = static_cast<char*>(memalign(page_size(), bytes));
#elif defined TORRENT_WINDOWS
ret = (char*)_aligned_malloc(bytes, page_size());
ret = static_cast<char*>(_aligned_malloc(bytes, page_size()));
#elif defined TORRENT_BEOS
area_id id = create_area("", &ret, B_ANY_ADDRESS
, (bytes + page_size() - 1) & (page_size()-1), B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (id < B_OK) return NULL;
ret = (char*)ret;
ret = static_cast<char*>(ret);
#else
ret = (char*)valloc(bytes);
ret = static_cast<char*>(valloc(size_t(bytes)));
#endif
if (ret == NULL) return NULL;

View File

@ -18,9 +18,13 @@
#define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT
#endif
#include "aux_/disable_warnings_push.hpp"
#if BOOST_VERSION >= 104500
#include <boost/asio/impl/src.hpp>
#elif BOOST_VERSION >= 104400
#include <boost/asio/impl/src.cpp>
#endif
#include "aux_/disable_warnings_pop.hpp"

View File

@ -31,12 +31,13 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
#include <boost/atomic.hpp>
#endif
#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \
#if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \
|| defined TORRENT_ASIO_DEBUGGING \
|| defined TORRENT_PROFILE_CALLS \
|| TORRENT_RELEASE_ASSERTS \
@ -214,7 +215,7 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth)
#if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
char const* libtorrent_assert_log = "asserts.log";
// the number of asserts we've printed to the log
boost::atomic<int> assert_counter(0);
@ -222,7 +223,7 @@ boost::atomic<int> assert_counter(0);
TORRENT_EXPORT void assert_print(char const* fmt, ...)
{
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
if (assert_counter > 500) return;
FILE* out = fopen(libtorrent_assert_log, "a+");
@ -235,15 +236,15 @@ TORRENT_EXPORT void assert_print(char const* fmt, ...)
vfprintf(out, fmt, va);
va_end(va);
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
if (out != stderr) fclose(out);
#endif
}
TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
, char const* function, char const* value, int kind)
TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(char const* expr, int line
, char const* file, char const* function, char const* value, int kind)
{
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
// no need to flood the assert log with infinite number of asserts
if (assert_counter.fetch_add(1) + 1 > 500) return;
#endif
@ -266,7 +267,7 @@ TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
}
assert_print("%s\n"
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
"#: %d\n"
#endif
"file: '%s'\n"
@ -277,7 +278,7 @@ TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
"stack:\n"
"%s\n"
, message
#if TORRENT_PRODUCTION_ASSERTS
#ifdef TORRENT_PRODUCTION_ASSERTS
, assert_counter.load()
#endif
, file, line, function, expr

View File

@ -33,9 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/close_reason.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/error_code.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/system/error_code.hpp>
#include <boost/asio/error.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{

View File

@ -33,8 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/crc32c.hpp"
#include "libtorrent/cpuid.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/crc.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
bool supports_sse42()

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <string>
#include <cctype>
#include <algorithm>
@ -40,11 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/array.hpp>
#include <boost/tuple/tuple.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/parse_url.hpp"
#include "libtorrent/random.hpp"
#ifdef TORRENT_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
@ -52,17 +49,24 @@ POSSIBILITY OF SUCH DAMAGE.
#include <windows.h>
#endif
#if TORRENT_USE_ICONV
#include <iconv.h>
#include <locale.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/parse_url.hpp"
#include "libtorrent/random.hpp"
#include "libtorrent/utf8.hpp"
#include "libtorrent/thread.hpp"
#include "libtorrent/aux_/escape_string.hpp"
#include "libtorrent/string_util.hpp" // for to_string
#if TORRENT_USE_ICONV
#include <iconv.h>
#include <locale.h>
#endif
namespace libtorrent
{

View File

@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cstring>
#include <vector>
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
#include <set>
#include "libtorrent/thread.hpp"
#endif
@ -1285,7 +1285,7 @@ namespace libtorrent
{
close();
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
m_file_path = path;
#endif
@ -1471,7 +1471,7 @@ namespace libtorrent
return true;
}
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
void file::print_info(FILE* out) const
{
if (!is_open()) return;
@ -2201,7 +2201,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
#endif
}
#if TORRENT_DEBUG_FILE_LEAKS
#ifdef TORRENT_DEBUG_FILE_LEAKS
std::set<file_handle*> global_file_handles;
mutex file_handle_mutex;

View File

@ -34,15 +34,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>
#include <stdio.h>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/optional.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/identify_client.hpp"
#include "libtorrent/fingerprint.hpp"

View File

@ -30,10 +30,14 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <utility>
#include <boost/bind.hpp>
#include <boost/function/function1.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/io.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/hasher.hpp"

View File

@ -32,22 +32,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector>
#include <utility>
#include <numeric>
#include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp"

View File

@ -33,22 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_NO_DEPRECATE
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector>
#include <utility>
#include <numeric>
#include <algorithm> // count
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp"

View File

@ -30,11 +30,23 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <boost/limits.hpp>
#include <boost/bind.hpp>
#include <boost/cstdint.hpp>
#ifdef TORRENT_DEBUG
#include <set>
#endif
#ifdef TORRENT_USE_OPENSSL
#include <openssl/rand.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#ifndef TORRENT_DISABLE_LOGGING
#include <stdarg.h> // for va_start, va_end
#include <stdio.h> // for vsnprintf
@ -72,14 +84,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/close_reason.hpp"
#include "libtorrent/aux_/time.hpp"
#ifdef TORRENT_DEBUG
#include <set>
#endif
#ifdef TORRENT_USE_OPENSSL
#include <openssl/rand.h>
#endif
//#define TORRENT_CORRUPT_DATA
using boost::shared_ptr;

View File

@ -30,16 +30,12 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/bind.hpp>
#include <boost/utility.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp"
#include "libtorrent/web_peer_connection.hpp"

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <cmath>
#include <algorithm>
@ -39,6 +41,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/piece_picker.hpp"
#include "libtorrent/bitfield.hpp"
#include "libtorrent/random.hpp"

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#include "libtorrent/random.hpp"
#include "libtorrent/assert.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/random/random_device.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include "aux_/disable_warnings_pop.hpp"
#if !TORRENT_THREADSAFE_STATIC
#include "libtorrent/thread.hpp"
#endif

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <algorithm>
#include <cctype>
@ -43,22 +45,20 @@ POSSIBILITY OF SUCH DAMAGE.
#endif
#endif // TORRENT_DEBUG && !TORRENT_DISABLE_INVARIANT_CHECKS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/limits.hpp>
#include <boost/bind.hpp>
#include <boost/function_equal.hpp>
#include <boost/make_shared.hpp>
#ifndef TORRENT_WINDOWS
#include <sys/resource.h>
#endif
#ifdef TORRENT_USE_VALGRIND
#include <valgrind/memcheck.h>
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/torrent_info.hpp"
@ -95,10 +95,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/torrent_peer.hpp"
#include "libtorrent/choker.hpp"
#ifndef TORRENT_WINDOWS
#include <sys/resource.h>
#endif
#ifndef TORRENT_DISABLE_LOGGING
#include "libtorrent/socket_io.hpp"

View File

@ -32,23 +32,19 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector>
#include <map>
#include <utility>
#include <numeric>
#include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/torrent.hpp"
#include "libtorrent/extensions.hpp"

View File

@ -30,15 +30,13 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <algorithm>
#include <set>
#include <functional>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/version.hpp>
@ -47,28 +45,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/system/system_error.hpp>
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/torrent.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/file_pool.hpp"
#include "libtorrent/aux_/session_impl.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#include "libtorrent/alloca.hpp"
#include "libtorrent/stat_cache.hpp"
#include <cstdio>
//#define TORRENT_PARTIAL_HASH_LOG
#if defined(__APPLE__)
// for getattrlist()
#include <sys/attr.h>
@ -88,6 +64,26 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/mount.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/torrent.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/file_pool.hpp"
#include "libtorrent/aux_/session_impl.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#include "libtorrent/alloca.hpp"
#include "libtorrent/stat_cache.hpp"
#include <cstdio>
//#define TORRENT_PARTIAL_HASH_LOG
// for convert_to_wstring and convert_to_native
#include "libtorrent/aux_/escape_string.hpp"

View File

@ -30,6 +30,10 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <algorithm>
#include <set>
@ -37,18 +41,20 @@ POSSIBILITY OF SUCH DAMAGE.
#include <numeric>
#include <limits> // for numeric_limits
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef TORRENT_USE_OPENSSL
#include "libtorrent/ssl_stream.hpp"
#include <boost/asio/ssl/context.hpp>
#include <openssl/rand.h>
#if BOOST_VERSION >= 104700
#include <boost/asio/ssl/verify_context.hpp>
#endif // BOOST_VERSION
#endif // TORRENT_USE_OPENSSL
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/torrent_handle.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/torrent_info.hpp"
@ -88,15 +94,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/alloca.hpp"
#include "libtorrent/resolve_links.hpp"
#ifdef TORRENT_USE_OPENSSL
#include "libtorrent/ssl_stream.hpp"
#include <boost/asio/ssl/context.hpp>
#include <openssl/rand.h>
#if BOOST_VERSION >= 104700
#include <boost/asio/ssl/verify_context.hpp>
#endif // BOOST_VERSION
#endif // TORRENT_USE_OPENSSL
#ifndef TORRENT_DISABLE_LOGGING
#include "libtorrent/aux_/session_impl.hpp" // for tracker_logger
#endif

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <ctime>
#include <iterator>
#include <algorithm>
@ -37,16 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cctype>
#include <algorithm>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/optional.hpp>
#include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/bt_peer_connection.hpp"

View File

@ -30,12 +30,16 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <cctype>
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/tracker_manager.hpp"
#include "libtorrent/http_tracker_connection.hpp"
#include "libtorrent/udp_tracker_connection.hpp"

View File

@ -30,19 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "aux_/disable_warnings_push.hpp"
#include <vector>
#include <cctype>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/tracker_manager.hpp"
#include "libtorrent/parse_url.hpp"

View File

@ -32,22 +32,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector>
#include <utility>
#include <numeric>
#include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp"

View File

@ -32,15 +32,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp"