Fixes for libtorrent version to be compiled with VS 2015

This commit is contained in:
Alexander Bock
2016-01-14 16:04:40 +01:00
parent 1ec01d9fea
commit b43f622a9f
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ endif ()
# Boost
set(Boost_USE_STATIC_LIBS ON)
if (NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)
find_package(Boost COMPONENTS system chrono REQUIRED)
find_package(Boost COMPONENTS REQUIRED system chrono date_time thread)
endif ()
target_include_directories(libtorrent PUBLIC ${Boost_INCLUDE_DIR})
target_link_libraries(libtorrent ${Boost_LIBRARIES})
@@ -155,9 +155,9 @@ void http_connection::get(std::string const& url, time_duration timeout, int pri
char* end = request + sizeof(request);
char* ptr = request;
#define APPEND_FMT(fmt) ptr += snprintf(ptr, end - ptr, fmt)
#define APPEND_FMT1(fmt, arg) ptr += snprintf(ptr, end - ptr, fmt, arg)
#define APPEND_FMT2(fmt, arg1, arg2) ptr += snprintf(ptr, end - ptr, fmt, arg1, arg2)
#define APPEND_FMT(fmt) ptr += snprintf(ptr, int(end - ptr), fmt)
#define APPEND_FMT1(fmt, arg) ptr += snprintf(ptr, int(end - ptr), fmt, arg)
#define APPEND_FMT2(fmt, arg1, arg2) ptr += snprintf(ptr, int(end - ptr), fmt, arg1, arg2)
// exclude ssl here, because SSL assumes CONNECT support in the
// proxy and is handled at the lower layer
@@ -69,7 +69,7 @@ namespace
ptr += (std::min)(salt.second, left);
left = canonical_length - (ptr - out);
}
ptr += snprintf(ptr, canonical_length - (ptr - out)
ptr += snprintf(ptr, int(canonical_length - (ptr - out))
, "3:seqi%" PRId64 "e1:v", seq);
left = canonical_length - (ptr - out);
memcpy(ptr, v.first, (std::min)(v.second, left));