diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b2bfc88..ad13b1f53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,7 @@ option(exceptions "build with exception support" ON) option(logging "build with logging" OFF) option(verbose-logging "build with verbose logging" OFF) option(build_tests "build tests" OFF) -option(build_examples "build examples" OFF) +option(build_examples "build examples" ON) set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo) @@ -163,7 +163,7 @@ include_directories(${Boost_INCLUDE_DIR}) target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}) # this works around a bug in asio in boost-1.39 -add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK) +add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK -D__USE_W32_SOCKETS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0500) if (WIN32) target_link_libraries(torrent-rasterbar wsock32 ws2_32) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 9b5283e53..fe5459bf1 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1140,7 +1140,9 @@ int main(int argc, char* argv[]) " -Q enables share mode. Share mode attempts to maximize\n" " share ratio rather than downloading\n" " -r connect to specified peer\n" +#ifndef TORRENT_DISABLE_ENCRYPTION " -e force encrypted bittorrent connections\n" +#endif "\n QUEING OPTIONS\n" " -v Set the max number of active downloads\n" " -^ Set the max number of active seeds\n" @@ -1308,6 +1310,7 @@ int main(int argc, char* argv[]) case 'F': refresh_delay = atoi(arg); break; case 'H': start_dht = false; --i; break; case 'l': settings.listen_queue_size = atoi(arg); break; +#ifndef TORRENT_DISABLE_ENCRYPTION case 'e': { pe_settings s; @@ -1319,6 +1322,7 @@ int main(int argc, char* argv[]) ses.set_pe_settings(s); break; } +#endif case 'W': settings.max_peerlist_size = atoi(arg); settings.max_paused_peerlist_size = atoi(arg) / 2; diff --git a/include/libtorrent/escape_string.hpp b/include/libtorrent/escape_string.hpp index 526bfd1d3..5c493faa8 100644 --- a/include/libtorrent/escape_string.hpp +++ b/include/libtorrent/escape_string.hpp @@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - TORRENT_EXTRA_EXPORT boost::array::digits10> to_string(size_type n); + TORRENT_EXTRA_EXPORT boost::array::digits10> to_string(size_type n); TORRENT_EXTRA_EXPORT bool is_alpha(char c); TORRENT_EXPORT bool is_digit(char c); TORRENT_EXTRA_EXPORT bool is_print(char c); diff --git a/src/escape_string.cpp b/src/escape_string.cpp index 021e6c770..4ad7ece3e 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -68,9 +68,9 @@ namespace libtorrent // lexical_cast's result depends on the locale. We need // a well defined result - boost::array::digits10> to_string(size_type n) + boost::array::digits10> to_string(size_type n) { - boost::array::digits10> ret; + boost::array::digits10> ret; char *p = &ret.back(); *p = '\0'; unsigned_size_type un = n; @@ -576,7 +576,7 @@ namespace libtorrent for (const char* i = &s[0]; i < end;) { wchar_t c = '.'; - int result = std::mbtowc(&c, i, end - i); + result = std::mbtowc(&c, i, end - i); if (result > 0) i += result; else ++i; ret += c; @@ -596,7 +596,7 @@ namespace libtorrent { char c[10]; TORRENT_ASSERT(sizeof(c) >= MB_CUR_MAX); - int result = std::wctomb(c, *i); + result = std::wctomb(c, *i); if (result > 0) { i += result; diff --git a/src/magnet_uri.cpp b/src/magnet_uri.cpp index a3fb3abaa..b9b936735 100644 --- a/src/magnet_uri.cpp +++ b/src/magnet_uri.cpp @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/session.hpp" #include "libtorrent/torrent_handle.hpp" #include "libtorrent/escape_string.hpp" +#include "libtorrent/error_code.hpp" #include @@ -95,8 +96,8 @@ namespace libtorrent return ret; } -#ifndef TORRENT_NO_DEPRECATE #ifndef BOOST_NO_EXCEPTIONS +#ifndef TORRENT_NO_DEPRECATE torrent_handle add_magnet_uri(session& ses, std::string const& uri , std::string const& save_path , storage_mode_t storage_mode