pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: libtorrent/rtorrent patch for testing
On Wed, Sep 11, 2013 at 04:47:30PM +0100, Matthias Scheler wrote:
> "rtorrent" doesn't build under Mac OS X Lion with 4.2.1 LVM:
*sigh* ancient crappy libstdc++. Try again with the attached patch,
please.
Joerg
Index: net/rtorrent/distinfo
==================================================================
--- net/rtorrent/distinfo
+++ net/rtorrent/distinfo
@@ -5,8 +5,50 @@
Size (rtorrent-0.9.2.tar.gz) = 591837 bytes
SHA1 (patch-ab) = 87873bb32166d00398ab0ef6421a6fe85a55c914
SHA1 (patch-ad) = f993340975dca61d5f7d7014b6959ee50b12a7b4
SHA1 (patch-ae) = a370881bfdd8534eb25fcbcff8d258b19797941f
SHA1 (patch-af) = 842a01cbc75e61092b4d33fe9155a728e7c502e6
-SHA1 (patch-ag) = b7e5fe242b19f994f013acc9ec54a65fed729c29
-SHA1 (patch-rak_functional__fun.h) = b495de4d2a3c2ef0ba3caaf8dd8dede7f322de91
+SHA1 (patch-ag) = 6f5acae1303138e876c33c7ccec3afb1b9c03bb0
+SHA1 (patch-rak_functional__fun.h) = 96ace345e3ca214da28d5e43ca5ce1f9d580bcf3
SHA1 (patch-rak_priority__queue__default.h) =
551bebdce83b2d84c31bafdb9f02217ea0df3a86
+SHA1 (patch-src_command__download.cc) =
cd3c1aea9d076e5e6eb5ea6bf3806a33581df7e4
+SHA1 (patch-src_command__dynamic.cc) = 7893620604e264cf433c50c69c32c07caf26607e
+SHA1 (patch-src_command__events.cc) = 0086e67a1d3132c4074ceef512cb003bb3dd9e31
+SHA1 (patch-src_command__file.cc) = 3f077dd9d4a842924771d52c253d62e32b4041fa
+SHA1 (patch-src_command__groups.cc) = af31d22830e6802b94b3d492b34686895cf4e056
+SHA1 (patch-src_command__helpers.h) = 19b32d6d7f8107ef5ce1ddab11997fc616db89e8
+SHA1 (patch-src_command__ip.cc) = 389d7d938fe4d65543bc0b8cdf8b53e8115a14eb
+SHA1 (patch-src_command__local.cc) = 5c7eb8fa0351057080d50a7254ce92405d5d6b12
+SHA1 (patch-src_command__network.cc) = 592f6a11bc4fc935dcb3c3d03f8ba39a18a891e5
+SHA1 (patch-src_command__peer.cc) = f7d892b81746887b6b88a029ca124ee71d0b3f6b
+SHA1 (patch-src_command__scheduler.cc) =
87496e0ec21d398db6560870866881b901e5c398
+SHA1 (patch-src_command__throttle.cc) =
e3556f3bb22a98da76667a1ff4c6446bf41e8fe2
+SHA1 (patch-src_command__tracker.cc) = 7fa4efe2d426301c5b6bfae7b24e3236e6146be9
+SHA1 (patch-src_command__ui.cc) = 94442f45b470877658fc4f97810802134cceb1b4
+SHA1 (patch-src_control.cc) = 9062fcce933a440d3eebdf3bb532ca8a117f172c
+SHA1 (patch-src_core_curl__get.cc) = 5e916fd25ead23546e70b9b1c6a7499fd6cca95c
+SHA1 (patch-src_core_curl__stack.cc) = 2e64ad9090231b1f9b12d6e2f4adc39864d39a97
+SHA1 (patch-src_core_dht__manager.cc) =
ea409fd23b6a2c109241c6eef4a8bb7b47b02eba
+SHA1 (patch-src_core_download.cc) = 362037139fc649f1c29bcbe54efb9d4cb5f2d599
+SHA1 (patch-src_core_download__factory.cc) =
888eee207e33438d539ee43664e8684e8ba87f91
+SHA1 (patch-src_core_download__list.cc) =
450b8a232afac738d3535a62ac110ddc9aac9521
+SHA1 (patch-src_core_http__queue.cc) = 532b406145316effa807495c24b9de36413b05c5
+SHA1 (patch-src_core_manager.cc) = 8948087c7380dcac6761c328ff1967cf7f0d7531
+SHA1 (patch-src_core_manager.h) = 12b77e2935476867a74cc4f35bf202439929fa2f
+SHA1 (patch-src_core_view.cc) = 4c96a599e076e3a8517c26c85baa88a68b55c6f8
+SHA1 (patch-src_display_frame.cc) = a215a625648811c2fa609b8017d94fefa46b470a
+SHA1 (patch-src_display_manager.cc) = 0e7bcca860060d0de762b7d89a790a1bd15eca29
+SHA1 (patch-src_display_window.cc) = c48ede5d3864e89f07ddb0b8c489ec9e19c68acf
+SHA1 (patch-src_display_window__file__list.cc) =
ba005aa1a12317f190a6ec47277e7545b37f2a1c
+SHA1 (patch-src_display_window__log.cc) =
534d2f430308c7aa611e86636da1d2b3a49feb95
+SHA1 (patch-src_rpc_command.h) = ac599d4c8e685702573590854ff821f316dad19f
+SHA1 (patch-src_rpc_command__scheduler.cc) =
7227e15eb104502824f878b5460462dffc58d6fc
+SHA1 (patch-src_rpc_command__scheduler__item.h) =
2e132790c1244d5c3b0d02db451581403e1ea1a3
+SHA1 (patch-src_rpc_exec__file.cc) = 693a089f7fe8d1e198ec14c3ff44cc49061d3a8b
+SHA1 (patch-src_rpc_exec__file.h) = d3daa876a47c3a0e09e90e81147ec4f824d03ab8
+SHA1 (patch-src_rpc_object__storage.cc) =
037903650695d7e87769c87ac6d669dfc237e7bf
+SHA1 (patch-src_rpc_object__storage.h) =
2ea0e2ea2c6ebd5f5e8eba0040630771f48cbee7
+SHA1 (patch-src_rpc_xmlrpc.h) = 5f35ee1e89dd20161560b769d14ae15186fbbf83
+SHA1 (patch-src_signal__handler.cc) = a79d2dcd9a14de1e221ab94d2a14fe70b9b9ce36
+SHA1 (patch-src_thread__base.cc) = cd0c112c879b934d1ddba8eeef421601914d61c7
+SHA1 (patch-src_ui_element__log__complete.cc) =
f5937552ed559bf4eb29eb03e50cae4aa47ae253
+SHA1 (patch-src_ui_element__peer__list.cc) =
073dac0a81095bcebd9583dab65110b32bf22a3f
Index: net/rtorrent/patches/patch-ag
==================================================================
--- net/rtorrent/patches/patch-ag
+++ net/rtorrent/patches/patch-ag
@@ -3,12 +3,42 @@
Fix handling of command line options. Please look here for details:
http://libtorrent.rakshasa.no/ticket/2657
--- src/main.cc.orig 2012-03-20 15:09:58.000000000 +0000
-+++ src/main.cc 2012-05-14 23:44:41.000000000 +0100
-@@ -843,14 +843,14 @@
++++ src/main.cc
+@@ -79,6 +79,14 @@
+
+ #include "thread_worker.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ void handle_sigbus(int signum, siginfo_t* sa, void* ptr);
+ void do_panic(int signum);
+ void print_help();
+@@ -208,11 +216,11 @@ main(int argc, char** argv) {
+ torrent::log_add_group_output(torrent::LOG_NOTICE, "important");
+ torrent::log_add_group_output(torrent::LOG_INFO, "complete");
+
+- torrent::Poll::slot_create_poll() = std::tr1::bind(&core::create_poll);
++ torrent::Poll::slot_create_poll() = bind(&core::create_poll);
+
+ torrent::initialize();
+- torrent::main_thread()->slot_do_work() = tr1::bind(&client_perform);
+- torrent::main_thread()->slot_next_timeout() =
tr1::bind(&client_next_timeout, control);
++ torrent::main_thread()->slot_do_work() = bind(&client_perform);
++ torrent::main_thread()->slot_next_timeout() = bind(&client_next_timeout,
control);
+
+ worker_thread = new ThreadWorker();
+ worker_thread->init_thread();
+@@ -843,14 +851,14 @@ main(int argc, char** argv) {
}
#endif
- int firstArg = parse_options(control, argc, argv);
-
ADDED net/rtorrent/patches/patch-rak_functional__fun.h
Index: net/rtorrent/patches/patch-rak_functional__fun.h
==================================================================
--- net/rtorrent/patches/patch-rak_functional__fun.h
+++ net/rtorrent/patches/patch-rak_functional__fun.h
@@ -0,0 +1,101 @@
+$NetBSD$
+
+--- rak/functional_fun.h.orig 2012-02-14 03:32:01.000000000 +0000
++++ rak/functional_fun.h
+@@ -53,8 +53,14 @@
+
+ #include <memory>
+ #include <functional>
++#if __cplusplus >= 201103L
++#include <memory>
++using std::shared_ptr;
++#else
+ #include <tr1/functional>
+ #include <tr1/memory>
++using std::tr1::shared_ptr;
++#endif
+
+ namespace rak {
+
+@@ -98,13 +104,13 @@ public:
+
+ bool is_valid() const { return m_base.get() != NULL; }
+
+- void set(base_type* base) { m_base =
std::tr1::shared_ptr<base_type>(base); }
++ void set(base_type* base) { m_base =
shared_ptr<base_type>(base); }
+ base_type* release() { return m_base.release(); }
+
+ Result operator () () { return (*m_base)(); }
+
+ private:
+- std::tr1::shared_ptr<base_type> m_base;
++ shared_ptr<base_type> m_base;
+ };
+
+ template <typename Result, typename Arg1>
+@@ -115,13 +121,13 @@ public:
+
+ bool is_valid() const { return m_base.get() != NULL; }
+
+- void set(base_type* base) { m_base =
std::tr1::shared_ptr<base_type>(base); }
++ void set(base_type* base) { m_base =
shared_ptr<base_type>(base); }
+ base_type* release() { return m_base.release(); }
+
+ Result operator () (Arg1 arg1) { return (*m_base)(arg1); }
+
+ private:
+- std::tr1::shared_ptr<base_type> m_base;
++ shared_ptr<base_type> m_base;
+ };
+
+ template <typename Result, typename Arg1, typename Arg2>
+@@ -132,13 +138,13 @@ public:
+
+ bool is_valid() const { return m_base.get() != NULL; }
+
+- void set(base_type* base) { m_base =
std::tr1::shared_ptr<base_type>(base); }
++ void set(base_type* base) { m_base =
shared_ptr<base_type>(base); }
+ base_type* release() { return m_base.release(); }
+
+ Result operator () (Arg1 arg1, Arg2 arg2) { return (*m_base)(arg1, arg2); }
+
+ private:
+- std::tr1::shared_ptr<base_type> m_base;
++ shared_ptr<base_type> m_base;
+ };
+
+ template <typename Result, typename Arg2>
+@@ -149,7 +155,7 @@ public:
+
+ bool is_valid() const { return m_base.get() != NULL; }
+
+- void set(base_type* base) { m_base =
std::tr1::shared_ptr<base_type>(base); }
++ void set(base_type* base) { m_base =
shared_ptr<base_type>(base); }
+ base_type* release() { return m_base.release(); }
+
+ Result operator () (Arg2 arg2) { return (*m_base)(arg2); }
+@@ -158,7 +164,7 @@ public:
+ Result operator () (Discard discard, Arg2 arg2) { return (*m_base)(arg2); }
+
+ private:
+- std::tr1::shared_ptr<base_type> m_base;
++ shared_ptr<base_type> m_base;
+ };
+
+ template <typename Result, typename Arg1, typename Arg2, typename Arg3>
+@@ -169,13 +175,13 @@ public:
+
+ bool is_valid() const { return m_base.get() != NULL; }
+
+- void set(base_type* base) { m_base =
std::tr1::shared_ptr<base_type>(base); }
++ void set(base_type* base) { m_base =
shared_ptr<base_type>(base); }
+ base_type* release() { return m_base.release(); }
+
+ Result operator () (Arg1 arg1, Arg2 arg2, Arg3 arg3) { return
(*m_base)(arg1, arg2, arg3); }
+
+ private:
+- std::tr1::shared_ptr<base_type> m_base;
++ shared_ptr<base_type> m_base;
+ };
+
+ template <typename Result>
ADDED net/rtorrent/patches/patch-rak_priority__queue__default.h
Index: net/rtorrent/patches/patch-rak_priority__queue__default.h
==================================================================
--- net/rtorrent/patches/patch-rak_priority__queue__default.h
+++ net/rtorrent/patches/patch-rak_priority__queue__default.h
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- rak/priority_queue_default.h.orig 2012-02-14 03:32:01.000000000 +0000
++++ rak/priority_queue_default.h
+@@ -38,7 +38,13 @@
+ #define RAK_PRIORITY_QUEUE_DEFAULT_H
+
+ #include <stdexcept>
++#if __cplusplus >= 201103L
++#include <functional>
++using std::function;
++#else
+ #include <tr1/functional>
++using std::tr1::function;
++#endif
+ #include <rak/allocators.h>
+ #include <rak/priority_queue.h>
+ #include <rak/timer.h>
+@@ -47,7 +53,7 @@ namespace rak {
+
+ class priority_item {
+ public:
+- typedef std::tr1::function<void (void)> slot_void;
++ typedef function<void (void)> slot_void;
+
+ priority_item() {}
+ ~priority_item() {
ADDED net/rtorrent/patches/patch-src_command__download.cc
Index: net/rtorrent/patches/patch-src_command__download.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__download.cc
+++ net/rtorrent/patches/patch-src_command__download.cc
@@ -0,0 +1,420 @@
+$NetBSD$
+
+--- src/command_download.cc.orig 2012-04-09 06:39:14.000000000 +0000
++++ src/command_download.cc
+@@ -69,6 +69,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++#define STD_BIND std::bind
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++#define STD_BIND std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ std::string
+ retrieve_d_base_path(core::Download* download) {
+ if (download->file_list()->is_multi_file())
+@@ -285,8 +295,8 @@ retrieve_d_bitfield(core::Download* down
+ // Just a helper function atm.
+ torrent::Object
+ cmd_d_initialize_logs(core::Download* download) {
+-
download->info()->signal_network_log().push_back(tr1::bind(&core::Manager::push_log_complete,
control->core(), tr1::placeholders::_1));
+-
download->info()->signal_storage_error().push_back(tr1::bind(&core::Manager::push_log_complete,
control->core(), tr1::placeholders::_1));
++
download->info()->signal_network_log().push_back(STD_BIND(&core::Manager::push_log_complete,
control->core(), STD_PLACEHOLDERS::_1));
++
download->info()->signal_storage_error().push_back(STD_BIND(&core::Manager::push_log_complete,
control->core(), STD_PLACEHOLDERS::_1));
+
+ return torrent::Object();
+ }
+@@ -363,7 +373,7 @@ f_multicall(core::Download* download, co
+ if (args.front().is_list())
+ std::transform(args.front().as_list().begin(),
args.front().as_list().end(),
+ std::back_inserter(regex_list),
+- tr1::bind(&torrent::Object::as_string_c,
tr1::placeholders::_1));
++ STD_BIND(&torrent::Object::as_string_c,
STD_PLACEHOLDERS::_1));
+ else if (args.front().is_string() && !args.front().as_string().empty())
+ regex_list.push_back(args.front().as_string());
+ else
+@@ -372,7 +382,7 @@ f_multicall(core::Download* download, co
+ for (torrent::FileList::const_iterator itr =
download->file_list()->begin(), last = download->file_list()->end(); itr !=
last; itr++) {
+ if (use_regex &&
+ std::find_if(regex_list.begin(), regex_list.end(),
+- tr1::bind(&rak::regex::operator(),
tr1::placeholders::_1, (*itr)->path()->as_string())) == regex_list.end())
++ STD_BIND(&rak::regex::operator(), STD_PLACEHOLDERS::_1,
(*itr)->path()->as_string())) == regex_list.end())
+ continue;
+
+ torrent::Object::list_type& row = result.insert(result.end(),
torrent::Object::create_list())->as_list();
+@@ -588,52 +598,52 @@ d_list_remove(core::Download* download,
+ return torrent::Object();
+ }
+
+-#define CMD2_ON_INFO(func) tr1::bind(&torrent::DownloadInfo::func,
tr1::bind(&core::Download::info, tr1::placeholders::_1))
+-#define CMD2_ON_DATA(func) tr1::bind(&torrent::download_data::func,
tr1::bind(&core::Download::data, tr1::placeholders::_1))
+-#define CMD2_ON_DL(func) tr1::bind(&torrent::Download::func,
tr1::bind(&core::Download::download, tr1::placeholders::_1))
+-#define CMD2_ON_FL(func) tr1::bind(&torrent::FileList::func,
tr1::bind(&core::Download::file_list, tr1::placeholders::_1))
+-
+-#define CMD2_BIND_DL tr1::bind(&core::Download::download,
tr1::placeholders::_1)
+-#define CMD2_BIND_CL tr1::bind(&core::Download::connection_list,
tr1::placeholders::_1)
+-#define CMD2_BIND_FL tr1::bind(&core::Download::file_list,
tr1::placeholders::_1)
+-#define CMD2_BIND_PL tr1::bind(&core::Download::c_peer_list,
tr1::placeholders::_1)
+-#define CMD2_BIND_TL tr1::bind(&core::Download::tracker_list,
tr1::placeholders::_1)
+-#define CMD2_BIND_TC tr1::bind(&core::Download::tracker_controller,
tr1::placeholders::_1)
++#define CMD2_ON_INFO(func) STD_BIND(&torrent::DownloadInfo::func,
STD_BIND(&core::Download::info, STD_PLACEHOLDERS::_1))
++#define CMD2_ON_DATA(func) STD_BIND(&torrent::download_data::func,
STD_BIND(&core::Download::data, STD_PLACEHOLDERS::_1))
++#define CMD2_ON_DL(func) STD_BIND(&torrent::Download::func,
STD_BIND(&core::Download::download, STD_PLACEHOLDERS::_1))
++#define CMD2_ON_FL(func) STD_BIND(&torrent::FileList::func,
STD_BIND(&core::Download::file_list, STD_PLACEHOLDERS::_1))
++
++#define CMD2_BIND_DL STD_BIND(&core::Download::download, STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_CL STD_BIND(&core::Download::connection_list,
STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_FL STD_BIND(&core::Download::file_list,
STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_PL STD_BIND(&core::Download::c_peer_list,
STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_TL STD_BIND(&core::Download::tracker_list,
STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_TC STD_BIND(&core::Download::tracker_controller,
STD_PLACEHOLDERS::_1)
+
+-#define CMD2_BIND_INFO tr1::bind(&core::Download::info, tr1::placeholders::_1)
+-#define CMD2_BIND_DATA tr1::bind(&core::Download::data, tr1::placeholders::_1)
++#define CMD2_BIND_INFO STD_BIND(&core::Download::info, STD_PLACEHOLDERS::_1)
++#define CMD2_BIND_DATA STD_BIND(&core::Download::data, STD_PLACEHOLDERS::_1)
+
+ #define CMD2_DL_VAR_VALUE(key, first_key, second_key) \
+- CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1,
first_key, second_key)); \
+- CMD2_DL_VALUE_P(key ".set", tr1::bind(&download_set_variable_value, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL(key, STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1,
first_key, second_key)); \
++ CMD2_DL_VALUE_P(key ".set", STD_BIND(&download_set_variable_value, \
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key));
+
+ #define CMD2_DL_VAR_VALUE_PUBLIC(key, first_key, second_key) \
+- CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1,
first_key, second_key)); \
+- CMD2_DL_VALUE(key ".set", tr1::bind(&download_set_variable_value, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL(key, STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1,
first_key, second_key)); \
++ CMD2_DL_VALUE(key ".set", STD_BIND(&download_set_variable_value, \
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key));
+
+ #define CMD2_DL_TIMESTAMP(key, first_key, second_key) \
+- CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1,
first_key, second_key)); \
+- CMD2_DL_VALUE_P(key ".set", tr1::bind(&download_set_variable_value, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL(key, STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1,
first_key, second_key)); \
++ CMD2_DL_VALUE_P(key ".set", STD_BIND(&download_set_variable_value, \
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key)); \
+- CMD2_DL_VALUE_P(key ".set_if_z",
tr1::bind(&download_set_variable_value_ifz, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL_VALUE_P(key ".set_if_z", STD_BIND(&download_set_variable_value_ifz,
\
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key)); \
+
+ #define CMD2_DL_VAR_STRING(key, first_key, second_key) \
+- CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1,
first_key, second_key)); \
+- CMD2_DL_STRING_P(key ".set", tr1::bind(&download_set_variable_string, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL(key, STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1,
first_key, second_key)); \
++ CMD2_DL_STRING_P(key ".set", STD_BIND(&download_set_variable_string, \
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key));
+
+ #define CMD2_DL_VAR_STRING_PUBLIC(key, first_key, second_key)
\
+- CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1,
first_key, second_key)); \
+- CMD2_DL_STRING(key ".set", tr1::bind(&download_set_variable_string, \
+- tr1::placeholders::_1,
tr1::placeholders::_2, \
++ CMD2_DL(key, STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1,
first_key, second_key)); \
++ CMD2_DL_STRING(key ".set", STD_BIND(&download_set_variable_string, \
++ STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, \
+ first_key, second_key));
+
+ int64_t cg_d_group(core::Download* download);
+@@ -642,12 +652,12 @@ void cg_d_group_set(core::
+
+ void
+ initialize_command_download() {
+- CMD2_DL("d.hash",
tr1::bind(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(hash)));
+- CMD2_DL("d.local_id",
tr1::bind(&rak::transform_hex_str<torrent::HashString>,
CMD2_ON_INFO(local_id)));
+- CMD2_DL("d.local_id_html",
tr1::bind(&rak::copy_escape_html_str<torrent::HashString>,
CMD2_ON_INFO(local_id)));
+- CMD2_DL("d.bitfield", tr1::bind(&retrieve_d_bitfield,
tr1::placeholders::_1));
+- CMD2_DL("d.base_path", tr1::bind(&retrieve_d_base_path,
tr1::placeholders::_1));
+- CMD2_DL("d.base_filename", tr1::bind(&retrieve_d_base_filename,
tr1::placeholders::_1));
++ CMD2_DL("d.hash",
STD_BIND(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(hash)));
++ CMD2_DL("d.local_id",
STD_BIND(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(local_id)));
++ CMD2_DL("d.local_id_html",
STD_BIND(&rak::copy_escape_html_str<torrent::HashString>,
CMD2_ON_INFO(local_id)));
++ CMD2_DL("d.bitfield", STD_BIND(&retrieve_d_bitfield,
STD_PLACEHOLDERS::_1));
++ CMD2_DL("d.base_path", STD_BIND(&retrieve_d_base_path,
STD_PLACEHOLDERS::_1));
++ CMD2_DL("d.base_filename", STD_BIND(&retrieve_d_base_filename,
STD_PLACEHOLDERS::_1));
+
+ CMD2_DL("d.name", CMD2_ON_INFO(name));
+ CMD2_DL("d.creation_date", CMD2_ON_INFO(creation_date));
+@@ -657,19 +667,19 @@ initialize_command_download() {
+ // Network related:
+ //
+
+- CMD2_DL ("d.up.rate", tr1::bind(&torrent::Rate::rate,
CMD2_ON_INFO(up_rate)));
+- CMD2_DL ("d.up.total", tr1::bind(&torrent::Rate::total,
CMD2_ON_INFO(up_rate)));
+- CMD2_DL ("d.down.rate", tr1::bind(&torrent::Rate::rate,
CMD2_ON_INFO(down_rate)));
+- CMD2_DL ("d.down.total", tr1::bind(&torrent::Rate::total,
CMD2_ON_INFO(down_rate)));
+- CMD2_DL ("d.skip.rate", tr1::bind(&torrent::Rate::rate,
CMD2_ON_INFO(skip_rate)));
+- CMD2_DL ("d.skip.total", tr1::bind(&torrent::Rate::total,
CMD2_ON_INFO(skip_rate)));
++ CMD2_DL ("d.up.rate", STD_BIND(&torrent::Rate::rate,
CMD2_ON_INFO(up_rate)));
++ CMD2_DL ("d.up.total", STD_BIND(&torrent::Rate::total,
CMD2_ON_INFO(up_rate)));
++ CMD2_DL ("d.down.rate", STD_BIND(&torrent::Rate::rate,
CMD2_ON_INFO(down_rate)));
++ CMD2_DL ("d.down.total", STD_BIND(&torrent::Rate::total,
CMD2_ON_INFO(down_rate)));
++ CMD2_DL ("d.skip.rate", STD_BIND(&torrent::Rate::rate,
CMD2_ON_INFO(skip_rate)));
++ CMD2_DL ("d.skip.total", STD_BIND(&torrent::Rate::total,
CMD2_ON_INFO(skip_rate)));
+
+ CMD2_DL ("d.peer_exchange", CMD2_ON_INFO(is_pex_enabled));
+- CMD2_DL_VALUE_V ("d.peer_exchange.set",
tr1::bind(&torrent::Download::set_pex_enabled, CMD2_BIND_DL,
tr1::placeholders::_2));
++ CMD2_DL_VALUE_V ("d.peer_exchange.set",
STD_BIND(&torrent::Download::set_pex_enabled, CMD2_BIND_DL,
STD_PLACEHOLDERS::_2));
+
+- CMD2_DL_LIST ("d.create_link", tr1::bind(&apply_d_change_link,
tr1::placeholders::_1, tr1::placeholders::_2, 0));
+- CMD2_DL_LIST ("d.delete_link", tr1::bind(&apply_d_change_link,
tr1::placeholders::_1, tr1::placeholders::_2, 1));
+- CMD2_DL ("d.delete_tied", tr1::bind(&apply_d_delete_tied,
tr1::placeholders::_1));
++ CMD2_DL_LIST ("d.create_link", STD_BIND(&apply_d_change_link,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2, 0));
++ CMD2_DL_LIST ("d.delete_link", STD_BIND(&apply_d_change_link,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2, 1));
++ CMD2_DL ("d.delete_tied", STD_BIND(&apply_d_delete_tied,
STD_PLACEHOLDERS::_1));
+
+ CMD2_FUNC_SINGLE("d.start", "d.hashing_failed.set=0
;view.set_visible=started");
+ CMD2_FUNC_SINGLE("d.stop", "view.set_visible=stopped");
+@@ -683,36 +693,36 @@ initialize_command_download() {
+
+ CMD2_DL ("d.is_open", CMD2_ON_INFO(is_open));
+ CMD2_DL ("d.is_active", CMD2_ON_INFO(is_active));
+- CMD2_DL ("d.is_hash_checked",
tr1::bind(&torrent::Download::is_hash_checked, CMD2_BIND_DL));
+- CMD2_DL ("d.is_hash_checking",
tr1::bind(&torrent::Download::is_hash_checking, CMD2_BIND_DL));
+- CMD2_DL ("d.is_multi_file",
tr1::bind(&torrent::FileList::is_multi_file, CMD2_BIND_FL));
++ CMD2_DL ("d.is_hash_checked",
STD_BIND(&torrent::Download::is_hash_checked, CMD2_BIND_DL));
++ CMD2_DL ("d.is_hash_checking",
STD_BIND(&torrent::Download::is_hash_checking, CMD2_BIND_DL));
++ CMD2_DL ("d.is_multi_file",
STD_BIND(&torrent::FileList::is_multi_file, CMD2_BIND_FL));
+ CMD2_DL ("d.is_private", CMD2_ON_INFO(is_private));
+ CMD2_DL ("d.is_pex_active", CMD2_ON_INFO(is_pex_active));
+ CMD2_DL ("d.is_partially_done",
CMD2_ON_DATA(is_partially_done));
+ CMD2_DL ("d.is_not_partially_done",
CMD2_ON_DATA(is_not_partially_done));
+
+- CMD2_DL_V ("d.resume",
tr1::bind(&core::DownloadList::resume_default,
control->core()->download_list(), tr1::placeholders::_1));
+- CMD2_DL_V ("d.pause",
tr1::bind(&core::DownloadList::pause_default, control->core()->download_list(),
tr1::placeholders::_1));
+- CMD2_DL_V ("d.open", tr1::bind(&core::DownloadList::open_throw,
control->core()->download_list(), tr1::placeholders::_1));
+- CMD2_DL_V ("d.close",
tr1::bind(&core::DownloadList::close_throw, control->core()->download_list(),
tr1::placeholders::_1));
+- CMD2_DL_V ("d.close.directly",
tr1::bind(&core::DownloadList::close_directly,
control->core()->download_list(), tr1::placeholders::_1));
+- CMD2_DL_V ("d.erase", tr1::bind(&core::DownloadList::erase_ptr,
control->core()->download_list(), tr1::placeholders::_1));
+- CMD2_DL_V ("d.check_hash", tr1::bind(&core::DownloadList::check_hash,
control->core()->download_list(), tr1::placeholders::_1));
++ CMD2_DL_V ("d.resume",
STD_BIND(&core::DownloadList::resume_default, control->core()->download_list(),
STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.pause",
STD_BIND(&core::DownloadList::pause_default, control->core()->download_list(),
STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.open", STD_BIND(&core::DownloadList::open_throw,
control->core()->download_list(), STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.close", STD_BIND(&core::DownloadList::close_throw,
control->core()->download_list(), STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.close.directly",
STD_BIND(&core::DownloadList::close_directly, control->core()->download_list(),
STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.erase", STD_BIND(&core::DownloadList::erase_ptr,
control->core()->download_list(), STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.check_hash", STD_BIND(&core::DownloadList::check_hash,
control->core()->download_list(), STD_PLACEHOLDERS::_1));
+
+- CMD2_DL ("d.save_resume",
tr1::bind(&core::DownloadStore::save_resume, control->core()->download_store(),
tr1::placeholders::_1));
+- CMD2_DL ("d.save_full_session",
tr1::bind(&core::DownloadStore::save_full, control->core()->download_store(),
tr1::placeholders::_1));
++ CMD2_DL ("d.save_resume",
STD_BIND(&core::DownloadStore::save_resume, control->core()->download_store(),
STD_PLACEHOLDERS::_1));
++ CMD2_DL ("d.save_full_session",
STD_BIND(&core::DownloadStore::save_full, control->core()->download_store(),
STD_PLACEHOLDERS::_1));
+
+ CMD2_DL_V ("d.update_priorities", CMD2_ON_DL(update_priorities));
+
+- CMD2_DL_STRING_V("add_peer", tr1::bind(&apply_d_add_peer,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL_STRING_V("add_peer", STD_BIND(&apply_d_add_peer,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ //
+ // Custom settings:
+ //
+
+- CMD2_DL_STRING("d.custom", tr1::bind(&retrieve_d_custom,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_DL_STRING("d.custom_throw", tr1::bind(&retrieve_d_custom_throw,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_DL_LIST ("d.custom.set", tr1::bind(&apply_d_custom,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL_STRING("d.custom", STD_BIND(&retrieve_d_custom,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_STRING("d.custom_throw", STD_BIND(&retrieve_d_custom_throw,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_LIST ("d.custom.set", STD_BIND(&apply_d_custom,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ CMD2_DL_VAR_STRING_PUBLIC("d.custom1", "rtorrent", "custom1");
+ CMD2_DL_VAR_STRING_PUBLIC("d.custom2", "rtorrent", "custom2");
+@@ -757,68 +767,68 @@ initialize_command_download() {
+ CMD2_DL_TIMESTAMP("d.timestamp.started", "rtorrent",
"timestamp.started");
+ CMD2_DL_TIMESTAMP("d.timestamp.finished", "rtorrent",
"timestamp.finished");
+
+- CMD2_DL ("d.connection_current",
tr1::bind(&torrent::option_as_string, torrent::OPTION_CONNECTION_TYPE,
CMD2_ON_DL(connection_type)));
+- CMD2_DL_STRING("d.connection_current.set",
tr1::bind(&apply_d_connection_type, tr1::placeholders::_1,
tr1::placeholders::_2));
++ CMD2_DL ("d.connection_current",
STD_BIND(&torrent::option_as_string, torrent::OPTION_CONNECTION_TYPE,
CMD2_ON_DL(connection_type)));
++ CMD2_DL_STRING("d.connection_current.set",
STD_BIND(&apply_d_connection_type, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ CMD2_DL_VAR_STRING("d.connection_leech", "rtorrent",
"connection_leech");
+ CMD2_DL_VAR_STRING("d.connection_seed", "rtorrent",
"connection_seed");
+
+- CMD2_DL ("d.up.choke_heuristics",
tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
CMD2_ON_DL(upload_choke_heuristic)));
+- CMD2_DL_STRING("d.up.choke_heuristics.set",
tr1::bind(&apply_d_choke_heuristics, tr1::placeholders::_1,
tr1::placeholders::_2, false));
+- CMD2_DL ("d.down.choke_heuristics",
tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
CMD2_ON_DL(download_choke_heuristic)));
+- CMD2_DL_STRING("d.down.choke_heuristics.set",
tr1::bind(&apply_d_choke_heuristics, tr1::placeholders::_1,
tr1::placeholders::_2, true));
++ CMD2_DL ("d.up.choke_heuristics",
STD_BIND(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
CMD2_ON_DL(upload_choke_heuristic)));
++ CMD2_DL_STRING("d.up.choke_heuristics.set",
STD_BIND(&apply_d_choke_heuristics, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2,
false));
++ CMD2_DL ("d.down.choke_heuristics",
STD_BIND(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
CMD2_ON_DL(download_choke_heuristic)));
++ CMD2_DL_STRING("d.down.choke_heuristics.set",
STD_BIND(&apply_d_choke_heuristics, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2,
true));
+
+ CMD2_DL_VAR_STRING("d.up.choke_heuristics.leech", "rtorrent",
"choke_heuristics.up.leech");
+ CMD2_DL_VAR_STRING("d.up.choke_heuristics.seed", "rtorrent",
"choke_heuristics.up.seed");
+ CMD2_DL_VAR_STRING("d.down.choke_heuristics.leech", "rtorrent",
"choke_heuristics.down.leech");
+ CMD2_DL_VAR_STRING("d.down.choke_heuristics.seed", "rtorrent",
"choke_heuristics.down.seed");
+
+- CMD2_DL ("d.hashing_failed",
tr1::bind(&core::Download::is_hash_failed, tr1::placeholders::_1));
+- CMD2_DL_VALUE_V ("d.hashing_failed.set",
tr1::bind(&core::Download::set_hash_failed, tr1::placeholders::_1,
tr1::placeholders::_2));
++ CMD2_DL ("d.hashing_failed",
STD_BIND(&core::Download::is_hash_failed, STD_PLACEHOLDERS::_1));
++ CMD2_DL_VALUE_V ("d.hashing_failed.set",
STD_BIND(&core::Download::set_hash_failed, STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2));
+
+- CMD2_DL ("d.views",
tr1::bind(&download_get_variable, tr1::placeholders::_1, "rtorrent", "views"));
+- CMD2_DL ("d.views.has", tr1::bind(&d_list_has,
tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+- CMD2_DL ("d.views.remove", tr1::bind(&d_list_remove,
tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+- CMD2_DL ("d.views.push_back", tr1::bind(&d_list_push_back,
tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+- CMD2_DL ("d.views.push_back_unique",
tr1::bind(&d_list_push_back_unique, tr1::placeholders::_1,
tr1::placeholders::_2, "rtorrent", "views"));
++ CMD2_DL ("d.views",
STD_BIND(&download_get_variable, STD_PLACEHOLDERS::_1, "rtorrent", "views"));
++ CMD2_DL ("d.views.has", STD_BIND(&d_list_has,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2, "rtorrent", "views"));
++ CMD2_DL ("d.views.remove", STD_BIND(&d_list_remove,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2, "rtorrent", "views"));
++ CMD2_DL ("d.views.push_back", STD_BIND(&d_list_push_back,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2, "rtorrent", "views"));
++ CMD2_DL ("d.views.push_back_unique",
STD_BIND(&d_list_push_back_unique, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2,
"rtorrent", "views"));
+
+ // This command really needs to be improved, so we have proper
+ // logging support.
+- CMD2_DL ("d.message", tr1::bind(&core::Download::message,
tr1::placeholders::_1));
+- CMD2_DL_STRING_V("d.message.set", tr1::bind(&core::Download::set_message,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL ("d.message", STD_BIND(&core::Download::message,
STD_PLACEHOLDERS::_1));
++ CMD2_DL_STRING_V("d.message.set", STD_BIND(&core::Download::set_message,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ CMD2_DL ("d.max_file_size", CMD2_ON_FL(max_file_size));
+- CMD2_DL_VALUE_V ("d.max_file_size.set",
tr1::bind(&torrent::FileList::set_max_file_size, CMD2_BIND_FL,
tr1::placeholders::_2));
++ CMD2_DL_VALUE_V ("d.max_file_size.set",
STD_BIND(&torrent::FileList::set_max_file_size, CMD2_BIND_FL,
STD_PLACEHOLDERS::_2));
+
+- CMD2_DL ("d.peers_min",
tr1::bind(&torrent::ConnectionList::min_size, CMD2_BIND_CL));
+- CMD2_DL_VALUE_V ("d.peers_min.set",
tr1::bind(&torrent::ConnectionList::set_min_size, CMD2_BIND_CL,
tr1::placeholders::_2));
+- CMD2_DL ("d.peers_max",
tr1::bind(&torrent::ConnectionList::max_size, CMD2_BIND_CL));
+- CMD2_DL_VALUE_V ("d.peers_max.set",
tr1::bind(&torrent::ConnectionList::set_max_size, CMD2_BIND_CL,
tr1::placeholders::_2));
+- CMD2_DL ("d.uploads_max",
tr1::bind(&torrent::Download::uploads_max, CMD2_BIND_DL));
+- CMD2_DL_VALUE_V ("d.uploads_max.set",
tr1::bind(&torrent::Download::set_uploads_max, CMD2_BIND_DL,
tr1::placeholders::_2));
+- CMD2_DL ("d.uploads_min",
tr1::bind(&torrent::Download::uploads_min, CMD2_BIND_DL));
+- CMD2_DL_VALUE_V ("d.uploads_min.set",
tr1::bind(&torrent::Download::set_uploads_min, CMD2_BIND_DL,
tr1::placeholders::_2));
+- CMD2_DL ("d.downloads_max",
tr1::bind(&torrent::Download::downloads_max, CMD2_BIND_DL));
+- CMD2_DL_VALUE_V ("d.downloads_max.set",
tr1::bind(&torrent::Download::set_downloads_max, CMD2_BIND_DL,
tr1::placeholders::_2));
+- CMD2_DL ("d.downloads_min",
tr1::bind(&torrent::Download::downloads_min, CMD2_BIND_DL));
+- CMD2_DL_VALUE_V ("d.downloads_min.set",
tr1::bind(&torrent::Download::set_downloads_min, CMD2_BIND_DL,
tr1::placeholders::_2));
+- CMD2_DL ("d.peers_connected",
tr1::bind(&torrent::ConnectionList::size, CMD2_BIND_CL));
+- CMD2_DL ("d.peers_not_connected",
tr1::bind(&torrent::PeerList::available_list_size, CMD2_BIND_PL));
++ CMD2_DL ("d.peers_min",
STD_BIND(&torrent::ConnectionList::min_size, CMD2_BIND_CL));
++ CMD2_DL_VALUE_V ("d.peers_min.set",
STD_BIND(&torrent::ConnectionList::set_min_size, CMD2_BIND_CL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.peers_max",
STD_BIND(&torrent::ConnectionList::max_size, CMD2_BIND_CL));
++ CMD2_DL_VALUE_V ("d.peers_max.set",
STD_BIND(&torrent::ConnectionList::set_max_size, CMD2_BIND_CL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.uploads_max",
STD_BIND(&torrent::Download::uploads_max, CMD2_BIND_DL));
++ CMD2_DL_VALUE_V ("d.uploads_max.set",
STD_BIND(&torrent::Download::set_uploads_max, CMD2_BIND_DL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.uploads_min",
STD_BIND(&torrent::Download::uploads_min, CMD2_BIND_DL));
++ CMD2_DL_VALUE_V ("d.uploads_min.set",
STD_BIND(&torrent::Download::set_uploads_min, CMD2_BIND_DL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.downloads_max",
STD_BIND(&torrent::Download::downloads_max, CMD2_BIND_DL));
++ CMD2_DL_VALUE_V ("d.downloads_max.set",
STD_BIND(&torrent::Download::set_downloads_max, CMD2_BIND_DL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.downloads_min",
STD_BIND(&torrent::Download::downloads_min, CMD2_BIND_DL));
++ CMD2_DL_VALUE_V ("d.downloads_min.set",
STD_BIND(&torrent::Download::set_downloads_min, CMD2_BIND_DL,
STD_PLACEHOLDERS::_2));
++ CMD2_DL ("d.peers_connected",
STD_BIND(&torrent::ConnectionList::size, CMD2_BIND_CL));
++ CMD2_DL ("d.peers_not_connected",
STD_BIND(&torrent::PeerList::available_list_size, CMD2_BIND_PL));
+
+ CMD2_DL ("d.peers_complete", CMD2_ON_DL(peers_complete));
+ CMD2_DL ("d.peers_accounted", CMD2_ON_DL(peers_accounted));
+
+- CMD2_DL_V ("d.disconnect.seeders",
tr1::bind(&torrent::ConnectionList::erase_seeders, CMD2_BIND_CL));
++ CMD2_DL_V ("d.disconnect.seeders",
STD_BIND(&torrent::ConnectionList::erase_seeders, CMD2_BIND_CL));
+
+ CMD2_DL ("d.accepting_seeders",
CMD2_ON_INFO(is_accepting_seeders));
+- CMD2_DL_V ("d.accepting_seeders.enable",
tr1::bind(&torrent::DownloadInfo::public_set_flags, CMD2_BIND_INFO,
torrent::DownloadInfo::flag_accepting_seeders));
+- CMD2_DL_V ("d.accepting_seeders.disable",
tr1::bind(&torrent::DownloadInfo::public_unset_flags, CMD2_BIND_INFO,
torrent::DownloadInfo::flag_accepting_seeders));
++ CMD2_DL_V ("d.accepting_seeders.enable",
STD_BIND(&torrent::DownloadInfo::public_set_flags, CMD2_BIND_INFO,
torrent::DownloadInfo::flag_accepting_seeders));
++ CMD2_DL_V ("d.accepting_seeders.disable",
STD_BIND(&torrent::DownloadInfo::public_unset_flags, CMD2_BIND_INFO,
torrent::DownloadInfo::flag_accepting_seeders));
+
+- CMD2_DL ("d.throttle_name", tr1::bind(&download_get_variable,
tr1::placeholders::_1, "rtorrent", "throttle_name"));
+- CMD2_DL_STRING_V("d.throttle_name.set",
tr1::bind(&core::Download::set_throttle_name, tr1::placeholders::_1,
tr1::placeholders::_2));
++ CMD2_DL ("d.throttle_name", STD_BIND(&download_get_variable,
STD_PLACEHOLDERS::_1, "rtorrent", "throttle_name"));
++ CMD2_DL_STRING_V("d.throttle_name.set",
STD_BIND(&core::Download::set_throttle_name, STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2));
+
+ CMD2_DL ("d.bytes_done", CMD2_ON_DL(bytes_done));
+- CMD2_DL ("d.ratio", tr1::bind(&retrieve_d_ratio,
tr1::placeholders::_1));
++ CMD2_DL ("d.ratio", STD_BIND(&retrieve_d_ratio,
STD_PLACEHOLDERS::_1));
+ CMD2_DL ("d.chunks_hashed", CMD2_ON_DL(chunks_hashed));
+ CMD2_DL ("d.free_diskspace", CMD2_ON_FL(free_diskspace));
+
+@@ -829,7 +839,7 @@ initialize_command_download() {
+ CMD2_DL ("d.size_pex", CMD2_ON_DL(size_pex));
+ CMD2_DL ("d.max_size_pex", CMD2_ON_DL(max_size_pex));
+
+- CMD2_DL ("d.chunks_seen", tr1::bind(&d_chunks_seen,
tr1::placeholders::_1));
++ CMD2_DL ("d.chunks_seen", STD_BIND(&d_chunks_seen,
STD_PLACEHOLDERS::_1));
+
+ CMD2_DL ("d.completed_bytes", CMD2_ON_FL(completed_bytes));
+ CMD2_DL ("d.completed_chunks", CMD2_ON_FL(completed_chunks));
+@@ -837,44 +847,44 @@ initialize_command_download() {
+
+ CMD2_DL ("d.wanted_chunks", CMD2_ON_DATA(wanted_chunks));
+
+- CMD2_DL_V ("d.tracker_announce",
tr1::bind(&torrent::Download::manual_request, CMD2_BIND_DL, false));
+- CMD2_DL ("d.tracker_numwant",
tr1::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL));
+- CMD2_DL_VALUE_V ("d.tracker_numwant.set",
tr1::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL,
tr1::placeholders::_2));
++ CMD2_DL_V ("d.tracker_announce",
STD_BIND(&torrent::Download::manual_request, CMD2_BIND_DL, false));
++ CMD2_DL ("d.tracker_numwant",
STD_BIND(&torrent::TrackerList::numwant, CMD2_BIND_TL));
++ CMD2_DL_VALUE_V ("d.tracker_numwant.set",
STD_BIND(&torrent::TrackerList::set_numwant, CMD2_BIND_TL,
STD_PLACEHOLDERS::_2));
+ // TODO: Deprecate 'd.tracker_focus'.
+- CMD2_DL ("d.tracker_focus",
tr1::bind(&core::Download::tracker_list_size, tr1::placeholders::_1));
+- CMD2_DL ("d.tracker_size",
tr1::bind(&core::Download::tracker_list_size, tr1::placeholders::_1));
++ CMD2_DL ("d.tracker_focus",
STD_BIND(&core::Download::tracker_list_size, STD_PLACEHOLDERS::_1));
++ CMD2_DL ("d.tracker_size",
STD_BIND(&core::Download::tracker_list_size, STD_PLACEHOLDERS::_1));
+
+- CMD2_DL_LIST ("d.tracker.insert",
tr1::bind(&download_tracker_insert, tr1::placeholders::_1,
tr1::placeholders::_2));
+- CMD2_DL_VALUE_V ("d.tracker.send_scrape",
tr1::bind(&torrent::TrackerController::scrape_request, CMD2_BIND_TC,
tr1::placeholders::_2));
++ CMD2_DL_LIST ("d.tracker.insert",
STD_BIND(&download_tracker_insert, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_VALUE_V ("d.tracker.send_scrape",
STD_BIND(&torrent::TrackerController::scrape_request, CMD2_BIND_TC,
STD_PLACEHOLDERS::_2));
+
+ CMD2_DL ("d.directory", CMD2_ON_FL(root_dir));
+- CMD2_DL_STRING_V("d.directory.set", tr1::bind(&apply_d_directory,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL_STRING_V("d.directory.set", STD_BIND(&apply_d_directory,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+ CMD2_DL ("d.directory_base", CMD2_ON_FL(root_dir));
+- CMD2_DL_STRING_V("d.directory_base.set",
tr1::bind(&core::Download::set_root_directory, tr1::placeholders::_1,
tr1::placeholders::_2));
++ CMD2_DL_STRING_V("d.directory_base.set",
STD_BIND(&core::Download::set_root_directory, STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2));
+
+- CMD2_DL ("d.priority", tr1::bind(&core::Download::priority,
tr1::placeholders::_1));
+- CMD2_DL ("d.priority_str", tr1::bind(&retrieve_d_priority_str,
tr1::placeholders::_1));
+- CMD2_DL_VALUE_V ("d.priority.set", tr1::bind(&core::Download::set_priority,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL ("d.priority", STD_BIND(&core::Download::priority,
STD_PLACEHOLDERS::_1));
++ CMD2_DL ("d.priority_str", STD_BIND(&retrieve_d_priority_str,
STD_PLACEHOLDERS::_1));
++ CMD2_DL_VALUE_V ("d.priority.set", STD_BIND(&core::Download::set_priority,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+- // CMD2_DL ("d.group",
tr1::bind(&torrent::resource_manager_entry::group,
+- //
tr1::bind(&torrent::ResourceManager::entry_at, torrent::resource_manager(),
+- //
tr1::bind(&core::Download::main, tr1::placeholders::_1))));
++ // CMD2_DL ("d.group",
STD_BIND(&torrent::resource_manager_entry::group,
++ //
STD_BIND(&torrent::ResourceManager::entry_at, torrent::resource_manager(),
++ //
STD_BIND(&core::Download::main, STD_PLACEHOLDERS::_1))));
+
+- // CMD2_DL_V ("d.group.set",
tr1::bind(&torrent::ResourceManager::set_group,
++ // CMD2_DL_V ("d.group.set",
STD_BIND(&torrent::ResourceManager::set_group,
+ // torrent::resource_manager(),
+- //
tr1::bind(&torrent::ResourceManager::find_throw, torrent::resource_manager(),
+- //
tr1::bind(&core::Download::main, tr1::placeholders::_1)),
++ //
STD_BIND(&torrent::ResourceManager::find_throw, torrent::resource_manager(),
++ //
STD_BIND(&core::Download::main, STD_PLACEHOLDERS::_1)),
+ // CG_GROUP_INDEX()));
+
+- CMD2_DL ("d.group", tr1::bind(&cg_d_group,
tr1::placeholders::_1));
+- CMD2_DL ("d.group.name", tr1::bind(&cg_d_group,
tr1::placeholders::_1));
+- CMD2_DL_V ("d.group.set", tr1::bind(&cg_d_group_set,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL ("d.group", STD_BIND(&cg_d_group,
STD_PLACEHOLDERS::_1));
++ CMD2_DL ("d.group.name", STD_BIND(&cg_d_group,
STD_PLACEHOLDERS::_1));
++ CMD2_DL_V ("d.group.set", STD_BIND(&cg_d_group_set,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+- CMD2_DL ("d.initialize_logs", tr1::bind(&cmd_d_initialize_logs,
tr1::placeholders::_1));
++ CMD2_DL ("d.initialize_logs", STD_BIND(&cmd_d_initialize_logs,
STD_PLACEHOLDERS::_1));
+
+- CMD2_DL_LIST ("f.multicall", tr1::bind(&f_multicall,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_DL_LIST ("p.multicall", tr1::bind(&p_multicall,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_DL_LIST ("t.multicall", tr1::bind(&t_multicall,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_DL_LIST ("f.multicall", STD_BIND(&f_multicall,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_LIST ("p.multicall", STD_BIND(&p_multicall,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_LIST ("t.multicall", STD_BIND(&t_multicall,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST ("p.call_target", tr1::bind(&p_call_target,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("p.call_target", STD_BIND(&p_call_target,
STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__dynamic.cc
Index: net/rtorrent/patches/patch-src_command__dynamic.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__dynamic.cc
+++ net/rtorrent/patches/patch-src_command__dynamic.cc
@@ -0,0 +1,130 @@
+$NetBSD$
+
+--- src/command_dynamic.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_dynamic.cc
+@@ -43,6 +43,16 @@
+ #include "command_helpers.h"
+ #include "rpc/parse.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++#define STD_BIND std::bind
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++#define STD_BIND std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ std::string
+ system_method_generate_command(torrent::Object::list_const_iterator first,
torrent::Object::list_const_iterator last) {
+ std::string command;
+@@ -157,15 +167,15 @@ system_method_insert_object(const torren
+
+
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type>
>::type>
+ (create_new_key(rawKey),
+- tr1::bind(&rpc::object_storage::call_function_str,
control->object_storage(),
+- rawKey, tr1::placeholders::_1, tr1::placeholders::_2),
++ STD_BIND(&rpc::object_storage::call_function_str,
control->object_storage(),
++ rawKey, STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2),
+ &rpc::command_base_call<rpc::target_type>,
+ cmd_flags, NULL, NULL);
+
+ } else {
+
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type>
>::type>
+ (create_new_key(rawKey),
+- tr1::bind(&rpc::object_storage::get_str, control->object_storage(),
rawKey),
++ STD_BIND(&rpc::object_storage::get_str, control->object_storage(),
rawKey),
+ &rpc::command_base_call<rpc::target_type>,
+ cmd_flags, NULL, NULL);
+ }
+@@ -174,7 +184,7 @@ system_method_insert_object(const torren
+ // if (flags & rpc::object_storage::flag_rlookup) {
+ //
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_string<rpc::target_type>
>::type>
+ // (create_new_key<9>(rawKey, ".rlookup"),
+- // tr1::bind(&rpc::object_storage::rlookup_obj_list,
control->object_storage(), rawKey),
++ // STD_BIND(&rpc::object_storage::rlookup_obj_list,
control->object_storage(), rawKey),
+ // &rpc::command_base_call_string<rpc::target_type>,
+ // cmd_flags, NULL, NULL);
+ // }
+@@ -188,21 +198,21 @@ system_method_insert_object(const torren
+ case rpc::object_storage::flag_bool_type:
+
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_value<rpc::target_type>
>::type>
+ (create_new_key<5>(rawKey, ".set"),
+- tr1::bind(&rpc::object_storage::set_str_bool,
control->object_storage(), rawKey, tr1::placeholders::_2),
++ STD_BIND(&rpc::object_storage::set_str_bool,
control->object_storage(), rawKey, STD_PLACEHOLDERS::_2),
+ &rpc::command_base_call_value<rpc::target_type>,
+ cmd_flags, NULL, NULL);
+ break;
+ case rpc::object_storage::flag_value_type:
+
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_value<rpc::target_type>
>::type>
+ (create_new_key<5>(rawKey, ".set"),
+- tr1::bind(&rpc::object_storage::set_str_value,
control->object_storage(), rawKey, tr1::placeholders::_2),
++ STD_BIND(&rpc::object_storage::set_str_value,
control->object_storage(), rawKey, STD_PLACEHOLDERS::_2),
+ &rpc::command_base_call_value<rpc::target_type>,
+ cmd_flags, NULL, NULL);
+ break;
+ case rpc::object_storage::flag_string_type:
+
rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_string<rpc::target_type>
>::type>
+ (create_new_key<5>(rawKey, ".set"),
+- tr1::bind(&rpc::object_storage::set_str_string,
control->object_storage(), rawKey, tr1::placeholders::_2),
++ STD_BIND(&rpc::object_storage::set_str_string,
control->object_storage(), rawKey, STD_PLACEHOLDERS::_2),
+ &rpc::command_base_call_string<rpc::target_type>,
+ cmd_flags, NULL, NULL);
+ break;
+@@ -423,36 +433,36 @@ system_method_list_keys(const torrent::O
+ }
+
+ #define CMD2_METHOD_INSERT(key, flags) \
+- CMD2_ANY_LIST(key, tr1::bind(&system_method_insert_object,
tr1::placeholders::_2, flags));
++ CMD2_ANY_LIST(key, STD_BIND(&system_method_insert_object,
STD_PLACEHOLDERS::_2, flags));
+
+ void
+ initialize_command_dynamic() {
+ CMD2_VAR_BOOL ("method.use_deprecated", true);
+ CMD2_VAR_VALUE ("method.use_intermediate", 1);
+
+- CMD2_ANY_LIST ("method.insert",
tr1::bind(&system_method_insert, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("method.insert.value",
tr1::bind(&system_method_insert_object, tr1::placeholders::_2,
rpc::object_storage::flag_value_type));
++ CMD2_ANY_LIST ("method.insert",
STD_BIND(&system_method_insert, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("method.insert.value",
STD_BIND(&system_method_insert_object, STD_PLACEHOLDERS::_2,
rpc::object_storage::flag_value_type));
+
+ CMD2_METHOD_INSERT("method.insert.simple",
rpc::object_storage::flag_function_type);
+ CMD2_METHOD_INSERT("method.insert.c_simple",
rpc::object_storage::flag_constant | rpc::object_storage::flag_function_type);
+ CMD2_METHOD_INSERT("method.insert.s_c_simple",
rpc::object_storage::flag_static |
+ rpc::object_storage::flag_constant
|rpc::object_storage::flag_function_type);
+
+- CMD2_ANY_STRING ("method.erase", tr1::bind(&system_method_erase,
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("method.redirect", tr1::bind(&system_method_redirect,
tr1::placeholders::_2));
+- CMD2_ANY_STRING ("method.get",
tr1::bind(&rpc::object_storage::get_str, control->object_storage(),
+-
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("method.set",
tr1::bind(&system_method_set_function, tr1::placeholders::_2));
+-
+- CMD2_ANY_STRING ("method.const",
tr1::bind(&rpc::object_storage::has_flag_str, control->object_storage(),
+- tr1::placeholders::_2,
rpc::object_storage::flag_constant));
+- CMD2_ANY_STRING_V("method.const.enable",
tr1::bind(&rpc::object_storage::enable_flag_str, control->object_storage(),
+- tr1::placeholders::_2,
rpc::object_storage::flag_constant));
+-
+- CMD2_ANY_LIST ("method.has_key", tr1::bind(&system_method_has_key,
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("method.set_key", tr1::bind(&system_method_set_key,
tr1::placeholders::_2));
+- CMD2_ANY_STRING ("method.list_keys", tr1::bind(&system_method_list_keys,
tr1::placeholders::_2));
++ CMD2_ANY_STRING ("method.erase", STD_BIND(&system_method_erase,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("method.redirect", STD_BIND(&system_method_redirect,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING ("method.get",
STD_BIND(&rpc::object_storage::get_str, control->object_storage(),
++ STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("method.set", STD_BIND(&system_method_set_function,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY_STRING ("method.const",
STD_BIND(&rpc::object_storage::has_flag_str, control->object_storage(),
++ STD_PLACEHOLDERS::_2,
rpc::object_storage::flag_constant));
++ CMD2_ANY_STRING_V("method.const.enable",
STD_BIND(&rpc::object_storage::enable_flag_str, control->object_storage(),
++ STD_PLACEHOLDERS::_2,
rpc::object_storage::flag_constant));
++
++ CMD2_ANY_LIST ("method.has_key", STD_BIND(&system_method_has_key,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("method.set_key", STD_BIND(&system_method_set_key,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING ("method.list_keys", STD_BIND(&system_method_list_keys,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_STRING ("method.rlookup",
tr1::bind(&rpc::object_storage::rlookup_obj_list, control->object_storage(),
tr1::placeholders::_2));
+- CMD2_ANY_STRING_V("method.rlookup.clear",
tr1::bind(&rpc::object_storage::rlookup_clear, control->object_storage(),
tr1::placeholders::_2));
++ CMD2_ANY_STRING ("method.rlookup",
STD_BIND(&rpc::object_storage::rlookup_obj_list, control->object_storage(),
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING_V("method.rlookup.clear",
STD_BIND(&rpc::object_storage::rlookup_clear, control->object_storage(),
STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__events.cc
Index: net/rtorrent/patches/patch-src_command__events.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__events.cc
+++ net/rtorrent/patches/patch-src_command__events.cc
@@ -0,0 +1,75 @@
+$NetBSD$
+
+--- src/command_events.cc.orig 2012-04-18 07:55:20.000000000 +0000
++++ src/command_events.cc
+@@ -60,6 +60,16 @@
+
+ #include "thread_worker.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++#define STD_BIND std::bind
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++#define STD_BIND std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ torrent::Object
+ apply_on_ratio(const torrent::Object& rawArgs) {
+ const std::string& groupName = rawArgs.as_string();
+@@ -308,31 +318,31 @@ d_multicall(const torrent::Object::list_
+
+ void
+ initialize_command_events() {
+- CMD2_ANY_STRING ("on_ratio", tr1::bind(&apply_on_ratio,
tr1::placeholders::_2));
++ CMD2_ANY_STRING ("on_ratio", STD_BIND(&apply_on_ratio,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY ("start_tied", tr1::bind(&apply_start_tied));
+- CMD2_ANY ("stop_untied", tr1::bind(&apply_stop_untied));
+- CMD2_ANY ("close_untied", tr1::bind(&apply_close_untied));
+- CMD2_ANY ("remove_untied", tr1::bind(&apply_remove_untied));
+-
+- CMD2_ANY_LIST ("schedule2", tr1::bind(&apply_schedule,
tr1::placeholders::_2));
+- CMD2_ANY_STRING_V("schedule_remove2",
tr1::bind(&rpc::CommandScheduler::erase_str, control->command_scheduler(),
tr1::placeholders::_2));
+-
+- CMD2_ANY_STRING_V("import", tr1::bind(&apply_import,
tr1::placeholders::_2));
+- CMD2_ANY_STRING_V("try_import", tr1::bind(&apply_try_import,
tr1::placeholders::_2));
+-
+- CMD2_ANY_LIST ("load.normal", tr1::bind(&apply_load,
tr1::placeholders::_2, core::Manager::create_quiet |
core::Manager::create_tied));
+- CMD2_ANY_LIST ("load.verbose", tr1::bind(&apply_load,
tr1::placeholders::_2, core::Manager::create_tied));
+- CMD2_ANY_LIST ("load.start", tr1::bind(&apply_load,
tr1::placeholders::_2,
++ CMD2_ANY ("start_tied", STD_BIND(&apply_start_tied));
++ CMD2_ANY ("stop_untied", STD_BIND(&apply_stop_untied));
++ CMD2_ANY ("close_untied", STD_BIND(&apply_close_untied));
++ CMD2_ANY ("remove_untied", STD_BIND(&apply_remove_untied));
++
++ CMD2_ANY_LIST ("schedule2", STD_BIND(&apply_schedule,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING_V("schedule_remove2",
STD_BIND(&rpc::CommandScheduler::erase_str, control->command_scheduler(),
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY_STRING_V("import", STD_BIND(&apply_import,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING_V("try_import", STD_BIND(&apply_try_import,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY_LIST ("load.normal", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2, core::Manager::create_quiet |
core::Manager::create_tied));
++ CMD2_ANY_LIST ("load.verbose", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2, core::Manager::create_tied));
++ CMD2_ANY_LIST ("load.start", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2,
+
core::Manager::create_quiet | core::Manager::create_tied |
core::Manager::create_start));
+- CMD2_ANY_LIST ("load.start_verbose", tr1::bind(&apply_load,
tr1::placeholders::_2, core::Manager::create_tied |
core::Manager::create_start));
+- CMD2_ANY_LIST ("load.raw", tr1::bind(&apply_load,
tr1::placeholders::_2, core::Manager::create_quiet |
core::Manager::create_raw_data));
+- CMD2_ANY_LIST ("load.raw_verbose", tr1::bind(&apply_load,
tr1::placeholders::_2, core::Manager::create_raw_data));
+- CMD2_ANY_LIST ("load.raw_start", tr1::bind(&apply_load,
tr1::placeholders::_2,
++ CMD2_ANY_LIST ("load.start_verbose", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2, core::Manager::create_tied |
core::Manager::create_start));
++ CMD2_ANY_LIST ("load.raw", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2, core::Manager::create_quiet |
core::Manager::create_raw_data));
++ CMD2_ANY_LIST ("load.raw_verbose", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2, core::Manager::create_raw_data));
++ CMD2_ANY_LIST ("load.raw_start", STD_BIND(&apply_load,
STD_PLACEHOLDERS::_2,
+
core::Manager::create_quiet | core::Manager::create_start |
core::Manager::create_raw_data));
+
+- CMD2_ANY_VALUE ("close_low_diskspace",
tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2));
++ CMD2_ANY_VALUE ("close_low_diskspace",
STD_BIND(&apply_close_low_diskspace, STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST ("download_list", tr1::bind(&apply_download_list,
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("d.multicall2", tr1::bind(&d_multicall,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("download_list", STD_BIND(&apply_download_list,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("d.multicall2", STD_BIND(&d_multicall,
STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__file.cc
Index: net/rtorrent/patches/patch-src_command__file.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__file.cc
+++ net/rtorrent/patches/patch-src_command__file.cc
@@ -0,0 +1,104 @@
+$NetBSD$
+
+--- src/command_file.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_file.cc
+@@ -48,6 +48,17 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++#define STD_BIND std::bind
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++#define STD_BIND std::tr1::bind
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++using STD_BIND;
++
+ void
+ apply_f_set_priority(torrent::File* file, uint32_t value) {
+ if (value > torrent::PRIORITY_HIGH)
+@@ -100,45 +111,45 @@ apply_fi_filename_last(torrent::FileList
+
+ void
+ initialize_command_file() {
+- CMD2_FILE("f.is_created", tr1::bind(&torrent::File::is_created,
tr1::placeholders::_1));
+- CMD2_FILE("f.is_open", tr1::bind(&torrent::File::is_open,
tr1::placeholders::_1));
++ CMD2_FILE("f.is_created", bind(&torrent::File::is_created,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.is_open", bind(&torrent::File::is_open,
STD_PLACEHOLDERS::_1));
+
+- CMD2_FILE("f.is_create_queued",
tr1::bind(&torrent::File::is_create_queued, tr1::placeholders::_1));
+- CMD2_FILE("f.is_resize_queued",
tr1::bind(&torrent::File::is_resize_queued, tr1::placeholders::_1));
++ CMD2_FILE("f.is_create_queued",
bind(&torrent::File::is_create_queued, STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.is_resize_queued",
bind(&torrent::File::is_resize_queued, STD_PLACEHOLDERS::_1));
+
+- CMD2_FILE_VALUE_V("f.set_create_queued",
tr1::bind(&torrent::File::set_flags, tr1::placeholders::_1,
torrent::File::flag_create_queued));
+- CMD2_FILE_VALUE_V("f.set_resize_queued",
tr1::bind(&torrent::File::set_flags, tr1::placeholders::_1,
torrent::File::flag_resize_queued));
+- CMD2_FILE_VALUE_V("f.unset_create_queued",
tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1,
torrent::File::flag_create_queued));
+- CMD2_FILE_VALUE_V("f.unset_resize_queued",
tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1,
torrent::File::flag_resize_queued));
+-
+- CMD2_FILE ("f.prioritize_first",
tr1::bind(&torrent::File::has_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_first));
+- CMD2_FILE_V("f.prioritize_first.enable",
tr1::bind(&torrent::File::set_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_first));
+- CMD2_FILE_V("f.prioritize_first.disable",
tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_first));
+- CMD2_FILE ("f.prioritize_last",
tr1::bind(&torrent::File::has_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_last));
+- CMD2_FILE_V("f.prioritize_last.enable",
tr1::bind(&torrent::File::set_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_last));
+- CMD2_FILE_V("f.prioritize_last.disable",
tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1,
torrent::File::flag_prioritize_last));
+-
+- CMD2_FILE("f.size_bytes", tr1::bind(&torrent::File::size_bytes,
tr1::placeholders::_1));
+- CMD2_FILE("f.size_chunks",
tr1::bind(&torrent::File::size_chunks, tr1::placeholders::_1));
+- CMD2_FILE("f.completed_chunks",
tr1::bind(&torrent::File::completed_chunks, tr1::placeholders::_1));
+-
+- CMD2_FILE("f.offset", tr1::bind(&torrent::File::offset,
tr1::placeholders::_1));
+- CMD2_FILE("f.range_first",
tr1::bind(&torrent::File::range_first, tr1::placeholders::_1));
+- CMD2_FILE("f.range_second",
tr1::bind(&torrent::File::range_second, tr1::placeholders::_1));
+-
+- CMD2_FILE("f.priority", tr1::bind(&torrent::File::priority,
tr1::placeholders::_1));
+- CMD2_FILE_VALUE_V("f.priority.set", tr1::bind(&apply_f_set_priority,
tr1::placeholders::_1, tr1::placeholders::_2));
+-
+- CMD2_FILE("f.path", tr1::bind(&apply_f_path,
tr1::placeholders::_1));
+- CMD2_FILE("f.path_components", tr1::bind(&apply_f_path_components,
tr1::placeholders::_1));
+- CMD2_FILE("f.path_depth", tr1::bind(&apply_f_path_depth,
tr1::placeholders::_1));
+- CMD2_FILE("f.frozen_path",
tr1::bind(&torrent::File::frozen_path, tr1::placeholders::_1));
++ CMD2_FILE_VALUE_V("f.set_create_queued",
STD_BIND(&torrent::File::set_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_create_queued));
++ CMD2_FILE_VALUE_V("f.set_resize_queued",
STD_BIND(&torrent::File::set_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_resize_queued));
++ CMD2_FILE_VALUE_V("f.unset_create_queued",
STD_BIND(&torrent::File::unset_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_create_queued));
++ CMD2_FILE_VALUE_V("f.unset_resize_queued",
STD_BIND(&torrent::File::unset_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_resize_queued));
++
++ CMD2_FILE ("f.prioritize_first",
STD_BIND(&torrent::File::has_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_first));
++ CMD2_FILE_V("f.prioritize_first.enable",
STD_BIND(&torrent::File::set_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_first));
++ CMD2_FILE_V("f.prioritize_first.disable",
STD_BIND(&torrent::File::unset_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_first));
++ CMD2_FILE ("f.prioritize_last",
STD_BIND(&torrent::File::has_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_last));
++ CMD2_FILE_V("f.prioritize_last.enable",
STD_BIND(&torrent::File::set_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_last));
++ CMD2_FILE_V("f.prioritize_last.disable",
STD_BIND(&torrent::File::unset_flags, STD_PLACEHOLDERS::_1,
torrent::File::flag_prioritize_last));
++
++ CMD2_FILE("f.size_bytes", bind(&torrent::File::size_bytes,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.size_chunks", bind(&torrent::File::size_chunks,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.completed_chunks",
bind(&torrent::File::completed_chunks, STD_PLACEHOLDERS::_1));
++
++ CMD2_FILE("f.offset", bind(&torrent::File::offset,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.range_first", bind(&torrent::File::range_first,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.range_second", bind(&torrent::File::range_second,
STD_PLACEHOLDERS::_1));
++
++ CMD2_FILE("f.priority", bind(&torrent::File::priority,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE_VALUE_V("f.priority.set", STD_BIND(&apply_f_set_priority,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++
++ CMD2_FILE("f.path", bind(&apply_f_path,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.path_components", bind(&apply_f_path_components,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.path_depth", bind(&apply_f_path_depth,
STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.frozen_path", bind(&torrent::File::frozen_path,
STD_PLACEHOLDERS::_1));
+
+- CMD2_FILE("f.match_depth_prev",
tr1::bind(&torrent::File::match_depth_prev, tr1::placeholders::_1));
+- CMD2_FILE("f.match_depth_next",
tr1::bind(&torrent::File::match_depth_next, tr1::placeholders::_1));
++ CMD2_FILE("f.match_depth_prev",
bind(&torrent::File::match_depth_prev, STD_PLACEHOLDERS::_1));
++ CMD2_FILE("f.match_depth_next",
bind(&torrent::File::match_depth_next, STD_PLACEHOLDERS::_1));
+
+- CMD2_FILE("f.last_touched",
tr1::bind(&torrent::File::last_touched, tr1::placeholders::_1));
++ CMD2_FILE("f.last_touched", bind(&torrent::File::last_touched,
STD_PLACEHOLDERS::_1));
+
+- CMD2_FILEITR("fi.filename_last", tr1::bind(&apply_fi_filename_last,
tr1::placeholders::_1));
+- CMD2_FILEITR("fi.is_file",
tr1::bind(&torrent::FileListIterator::is_file, tr1::placeholders::_1));
++ CMD2_FILEITR("fi.filename_last", STD_BIND(&apply_fi_filename_last,
STD_PLACEHOLDERS::_1));
++ CMD2_FILEITR("fi.is_file",
bind(&torrent::FileListIterator::is_file, STD_PLACEHOLDERS::_1));
+ }
ADDED net/rtorrent/patches/patch-src_command__groups.cc
Index: net/rtorrent/patches/patch-src_command__groups.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__groups.cc
+++ net/rtorrent/patches/patch-src_command__groups.cc
@@ -0,0 +1,126 @@
+$NetBSD$
+
+--- src/command_groups.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_groups.cc
+@@ -52,6 +52,16 @@
+ // For cg_d_group.
+ #include "core/download.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ // A hack to allow testing of the new choke_group API without the
+ // working parts present.
+ #define USE_CHOKE_GROUP 0
+@@ -264,8 +274,8 @@ apply_cg_tracker_mode_set(const torrent:
+ return torrent::Object();
+ }
+
+-#define CG_GROUP_AT() tr1::bind(&cg_get_group, tr1::placeholders::_2)
+-#define CHOKE_GROUP(direction) tr1::bind(direction, CG_GROUP_AT())
++#define CG_GROUP_AT() bind(&cg_get_group, STD_PLACEHOLDERS::_2)
++#define CHOKE_GROUP(direction) bind(direction, CG_GROUP_AT())
+
+ /*
+
+@@ -336,54 +346,54 @@ options.
+ void
+ initialize_command_groups() {
+ // Move somewhere else?
+- CMD2_ANY ("strings.choke_heuristics",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
+- CMD2_ANY ("strings.choke_heuristics.upload",
tr1::bind(&torrent::option_list_strings,
torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
+- CMD2_ANY ("strings.choke_heuristics.download",
tr1::bind(&torrent::option_list_strings,
torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
+- CMD2_ANY ("strings.tracker_mode",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
++ CMD2_ANY ("strings.choke_heuristics",
bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
++ CMD2_ANY ("strings.choke_heuristics.upload",
bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
++ CMD2_ANY ("strings.choke_heuristics.download",
bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
++ CMD2_ANY ("strings.tracker_mode",
bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
+
+- CMD2_ANY ("choke_group.list",
tr1::bind(&apply_cg_list));
+- CMD2_ANY_STRING ("choke_group.insert",
tr1::bind(&apply_cg_insert, tr1::placeholders::_2));
++ CMD2_ANY ("choke_group.list", bind(&apply_cg_list));
++ CMD2_ANY_STRING ("choke_group.insert", bind(&apply_cg_insert,
STD_PLACEHOLDERS::_2));
+
+ #if USE_CHOKE_GROUP
+- CMD2_ANY ("choke_group.size",
tr1::bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
+- CMD2_ANY_STRING ("choke_group.index_of",
tr1::bind(&torrent::ResourceManager::group_index_of,
torrent::resource_manager(), tr1::placeholders::_2));
++ CMD2_ANY ("choke_group.size",
bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
++ CMD2_ANY_STRING ("choke_group.index_of",
bind(&torrent::ResourceManager::group_index_of, torrent::resource_manager(),
STD_PLACEHOLDERS::_2));
+ #else
+ apply_cg_insert("default");
+
+- CMD2_ANY ("choke_group.size",
tr1::bind(&std::vector<torrent::choke_group*>::size, cg_list_hack));
+- CMD2_ANY_STRING ("choke_group.index_of",
tr1::bind(&apply_cg_index_of, tr1::placeholders::_2));
++ CMD2_ANY ("choke_group.size",
bind(&std::vector<torrent::choke_group*>::size, cg_list_hack));
++ CMD2_ANY_STRING ("choke_group.index_of",
bind(&apply_cg_index_of, STD_PLACEHOLDERS::_2));
+ #endif
+
+ // Commands specific for a group. Supports as the first argument the
+ // name, the index or a negative index.
+- CMD2_ANY ("choke_group.general.size",
tr1::bind(&torrent::choke_group::size, CG_GROUP_AT()));
++ CMD2_ANY ("choke_group.general.size",
bind(&torrent::choke_group::size, CG_GROUP_AT()));
+
+- CMD2_ANY ("choke_group.tracker.mode",
tr1::bind(&torrent::option_as_string, torrent::OPTION_TRACKER_MODE,
+-
tr1::bind(&torrent::choke_group::tracker_mode, CG_GROUP_AT())));
+- CMD2_ANY_LIST ("choke_group.tracker.mode.set",
tr1::bind(&apply_cg_tracker_mode_set, tr1::placeholders::_2));
+-
+- CMD2_ANY ("choke_group.up.rate",
tr1::bind(&torrent::choke_group::up_rate, CG_GROUP_AT()));
+- CMD2_ANY ("choke_group.down.rate",
tr1::bind(&torrent::choke_group::down_rate, CG_GROUP_AT()));
+-
+- CMD2_ANY ("choke_group.up.max.unlimited",
tr1::bind(&torrent::choke_queue::is_unlimited,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
+- CMD2_ANY ("choke_group.up.max",
tr1::bind(&torrent::choke_queue::max_unchoked_signed,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
+- CMD2_ANY_LIST ("choke_group.up.max.set",
tr1::bind(&apply_cg_max_set, tr1::placeholders::_2, true));
+-
+- CMD2_ANY ("choke_group.up.total",
tr1::bind(&torrent::choke_queue::size_total,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
+- CMD2_ANY ("choke_group.up.queued",
tr1::bind(&torrent::choke_queue::size_queued,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
+- CMD2_ANY ("choke_group.up.unchoked",
tr1::bind(&torrent::choke_queue::size_unchoked,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
+- CMD2_ANY ("choke_group.up.heuristics",
tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
+-
tr1::bind(&torrent::choke_queue::heuristics,
CHOKE_GROUP(&torrent::choke_group::up_queue))));
+- CMD2_ANY_LIST ("choke_group.up.heuristics.set",
tr1::bind(&apply_cg_heuristics_set, tr1::placeholders::_2, true));
+-
+- CMD2_ANY ("choke_group.down.max.unlimited",
tr1::bind(&torrent::choke_queue::is_unlimited,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
+- CMD2_ANY ("choke_group.down.max",
tr1::bind(&torrent::choke_queue::max_unchoked_signed,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
+- CMD2_ANY_LIST ("choke_group.down.max.set",
tr1::bind(&apply_cg_max_set, tr1::placeholders::_2, false));
+-
+- CMD2_ANY ("choke_group.down.total",
tr1::bind(&torrent::choke_queue::size_total,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
+- CMD2_ANY ("choke_group.down.queued",
tr1::bind(&torrent::choke_queue::size_queued,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
+- CMD2_ANY ("choke_group.down.unchoked",
tr1::bind(&torrent::choke_queue::size_unchoked,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
+- CMD2_ANY ("choke_group.down.heuristics",
tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
+-
tr1::bind(&torrent::choke_queue::heuristics,
CHOKE_GROUP(&torrent::choke_group::down_queue))));
+- CMD2_ANY_LIST ("choke_group.down.heuristics.set",
tr1::bind(&apply_cg_heuristics_set, tr1::placeholders::_2, false));
++ CMD2_ANY ("choke_group.tracker.mode",
bind(&torrent::option_as_string, torrent::OPTION_TRACKER_MODE,
++
bind(&torrent::choke_group::tracker_mode, CG_GROUP_AT())));
++ CMD2_ANY_LIST ("choke_group.tracker.mode.set",
bind(&apply_cg_tracker_mode_set, STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("choke_group.up.rate",
bind(&torrent::choke_group::up_rate, CG_GROUP_AT()));
++ CMD2_ANY ("choke_group.down.rate",
bind(&torrent::choke_group::down_rate, CG_GROUP_AT()));
++
++ CMD2_ANY ("choke_group.up.max.unlimited",
bind(&torrent::choke_queue::is_unlimited,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
++ CMD2_ANY ("choke_group.up.max",
bind(&torrent::choke_queue::max_unchoked_signed,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
++ CMD2_ANY_LIST ("choke_group.up.max.set",
bind(&apply_cg_max_set, STD_PLACEHOLDERS::_2, true));
++
++ CMD2_ANY ("choke_group.up.total",
bind(&torrent::choke_queue::size_total,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
++ CMD2_ANY ("choke_group.up.queued",
bind(&torrent::choke_queue::size_queued,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
++ CMD2_ANY ("choke_group.up.unchoked",
bind(&torrent::choke_queue::size_unchoked,
CHOKE_GROUP(&torrent::choke_group::up_queue)));
++ CMD2_ANY ("choke_group.up.heuristics",
bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
++
bind(&torrent::choke_queue::heuristics,
CHOKE_GROUP(&torrent::choke_group::up_queue))));
++ CMD2_ANY_LIST ("choke_group.up.heuristics.set",
bind(&apply_cg_heuristics_set, STD_PLACEHOLDERS::_2, true));
++
++ CMD2_ANY ("choke_group.down.max.unlimited",
bind(&torrent::choke_queue::is_unlimited,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
++ CMD2_ANY ("choke_group.down.max",
bind(&torrent::choke_queue::max_unchoked_signed,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
++ CMD2_ANY_LIST ("choke_group.down.max.set",
bind(&apply_cg_max_set, STD_PLACEHOLDERS::_2, false));
++
++ CMD2_ANY ("choke_group.down.total",
bind(&torrent::choke_queue::size_total,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
++ CMD2_ANY ("choke_group.down.queued",
bind(&torrent::choke_queue::size_queued,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
++ CMD2_ANY ("choke_group.down.unchoked",
bind(&torrent::choke_queue::size_unchoked,
CHOKE_GROUP(&torrent::choke_group::down_queue)));
++ CMD2_ANY ("choke_group.down.heuristics",
bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
++
bind(&torrent::choke_queue::heuristics,
CHOKE_GROUP(&torrent::choke_group::down_queue))));
++ CMD2_ANY_LIST ("choke_group.down.heuristics.set",
bind(&apply_cg_heuristics_set, STD_PLACEHOLDERS::_2, false));
+ }
ADDED net/rtorrent/patches/patch-src_command__helpers.h
Index: net/rtorrent/patches/patch-src_command__helpers.h
==================================================================
--- net/rtorrent/patches/patch-src_command__helpers.h
+++ net/rtorrent/patches/patch-src_command__helpers.h
@@ -0,0 +1,74 @@
+$NetBSD$
+
+--- src/command_helpers.h.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_helpers.h
+@@ -41,8 +41,6 @@
+ #include "rpc/parse_commands.h"
+ #include "rpc/object_storage.h"
+
+-namespace tr1 { using namespace std::tr1; }
+-
+ void initialize_commands();
+
+ //
+@@ -100,43 +98,43 @@ void initialize_commands();
+
+ #define CMD2_VAR_BOOL(key, value) \
+ control->object_storage()->insert_c_str(key, int64_t(value),
rpc::object_storage::flag_bool_type); \
+- CMD2_ANY(key, tr1::bind(&rpc::object_storage::get,
control->object_storage(), \
++ CMD2_ANY(key, bind(&rpc::object_storage::get, control->object_storage(), \
+ torrent::raw_string::from_c_str(key))); \
+- CMD2_ANY_VALUE(key ".set", tr1::bind(&rpc::object_storage::set_bool,
control->object_storage(), \
+-
torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++ CMD2_ANY_VALUE(key ".set", bind(&rpc::object_storage::set_bool,
control->object_storage(), \
++
torrent::raw_string::from_c_str(key), STD_PLACEHOLDERS::_2));
+
+ #define CMD2_VAR_VALUE(key, value) \
+ control->object_storage()->insert_c_str(key, int64_t(value),
rpc::object_storage::flag_value_type); \
+- CMD2_ANY(key, tr1::bind(&rpc::object_storage::get,
control->object_storage(), \
++ CMD2_ANY(key, bind(&rpc::object_storage::get, control->object_storage(), \
+ torrent::raw_string::from_c_str(key))); \
+- CMD2_ANY_VALUE(key ".set", tr1::bind(&rpc::object_storage::set_value,
control->object_storage(), \
+-
torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++ CMD2_ANY_VALUE(key ".set", bind(&rpc::object_storage::set_value,
control->object_storage(), \
++
torrent::raw_string::from_c_str(key), STD_PLACEHOLDERS::_2));
+
+ #define CMD2_VAR_STRING(key, value) \
+ control->object_storage()->insert_c_str(key, value,
rpc::object_storage::flag_string_type); \
+- CMD2_ANY(key, tr1::bind(&rpc::object_storage::get,
control->object_storage(), \
++ CMD2_ANY(key, bind(&rpc::object_storage::get, control->object_storage(), \
+ torrent::raw_string::from_c_str(key))); \
+- CMD2_ANY_STRING(key ".set", tr1::bind(&rpc::object_storage::set_string,
control->object_storage(), \
+-
torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++ CMD2_ANY_STRING(key ".set", bind(&rpc::object_storage::set_string,
control->object_storage(), \
++
torrent::raw_string::from_c_str(key), STD_PLACEHOLDERS::_2));
+
+
+ #define CMD2_VAR_C_STRING(key, value) \
+ control->object_storage()->insert_c_str(key, value,
rpc::object_storage::flag_string_type); \
+- CMD2_ANY(key, tr1::bind(&rpc::object_storage::get,
control->object_storage(), \
++ CMD2_ANY(key, bind(&rpc::object_storage::get, control->object_storage(), \
+ torrent::raw_string::from_c_str(key)));
+
+ #define CMD2_VAR_LIST(key) \
+ control->object_storage()->insert_c_str(key,
torrent::Object::create_list(), rpc::object_storage::flag_list_type); \
+- CMD2_ANY(key, tr1::bind(&rpc::object_storage::get,
control->object_storage(), \
++ CMD2_ANY(key, bind(&rpc::object_storage::get, control->object_storage(), \
+ torrent::raw_string::from_c_str(key))); \
+- CMD2_ANY_LIST(key ".set", tr1::bind(&rpc::object_storage::set_list,
control->object_storage(), \
+-
torrent::raw_string::from_c_str(key), tr1::placeholders::_2)); \
+- CMD2_ANY_VOID(key ".push_back",
tr1::bind(&rpc::object_storage::list_push_back, control->object_storage(), \
+-
torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++ CMD2_ANY_LIST(key ".set", bind(&rpc::object_storage::set_list,
control->object_storage(), \
++
torrent::raw_string::from_c_str(key), STD_PLACEHOLDERS::_2)); \
++ CMD2_ANY_VOID(key ".push_back", bind(&rpc::object_storage::list_push_back,
control->object_storage(), \
++
torrent::raw_string::from_c_str(key), STD_PLACEHOLDERS::_2));
+
+ #define CMD2_FUNC_SINGLE(key, cmds) \
+- CMD2_ANY(key, tr1::bind(&rpc::command_function_call,
torrent::raw_string::from_c_str(cmds), \
+- tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_ANY(key, bind(&rpc::command_function_call,
torrent::raw_string::from_c_str(cmds), \
++ STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ #define CMD2_REDIRECT(from_key, to_key) \
+ rpc::commands.create_redirect(from_key, to_key,
rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_dont_delete);
ADDED net/rtorrent/patches/patch-src_command__ip.cc
Index: net/rtorrent/patches/patch-src_command__ip.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__ip.cc
+++ net/rtorrent/patches/patch-src_command__ip.cc
@@ -0,0 +1,51 @@
+$NetBSD$
+
+--- src/command_ip.cc.orig 2012-03-20 18:25:56.000000000 +0000
++++ src/command_ip.cc
+@@ -45,6 +45,16 @@
+ #include "globals.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ void
+ ipv4_filter_parse(const char* address, int value) {
+ uint32_t ip_values[4] = { 0, 0, 0, 0 };
+@@ -287,17 +297,17 @@ apply_ipv4_filter_dump() {
+
+ void
+ initialize_command_ip() {
+- CMD2_ANY ("strings.ip_filter",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
+- CMD2_ANY ("strings.ip_tos",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
++ CMD2_ANY ("strings.ip_filter",
bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
++ CMD2_ANY ("strings.ip_tos",
bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
+
+- CMD2_ANY_STRING ("ip_tables.insert_table",
tr1::bind(&apply_ip_tables_insert_table, tr1::placeholders::_2));
+- CMD2_ANY_STRING ("ip_tables.size_data",
tr1::bind(&apply_ip_tables_size_data, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("ip_tables.get",
tr1::bind(&apply_ip_tables_get, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("ip_tables.add_address",
tr1::bind(&apply_ip_tables_add_address, tr1::placeholders::_2));
+-
+- CMD2_ANY ("ipv4_filter.size_data",
tr1::bind(&apply_ipv4_filter_size_data));
+- CMD2_ANY_STRING ("ipv4_filter.get",
tr1::bind(&apply_ipv4_filter_get, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("ipv4_filter.add_address",
tr1::bind(&apply_ipv4_filter_add_address, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("ipv4_filter.load",
tr1::bind(&apply_ipv4_filter_load, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("ipv4_filter.dump",
tr1::bind(&apply_ipv4_filter_dump));
++ CMD2_ANY_STRING ("ip_tables.insert_table",
bind(&apply_ip_tables_insert_table, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING ("ip_tables.size_data",
bind(&apply_ip_tables_size_data, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("ip_tables.get", bind(&apply_ip_tables_get,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("ip_tables.add_address",
bind(&apply_ip_tables_add_address, STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("ipv4_filter.size_data",
bind(&apply_ipv4_filter_size_data));
++ CMD2_ANY_STRING ("ipv4_filter.get", bind(&apply_ipv4_filter_get,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("ipv4_filter.add_address",
bind(&apply_ipv4_filter_add_address, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("ipv4_filter.load", bind(&apply_ipv4_filter_load,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("ipv4_filter.dump", bind(&apply_ipv4_filter_dump));
+ }
ADDED net/rtorrent/patches/patch-src_command__local.cc
Index: net/rtorrent/patches/patch-src_command__local.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__local.cc
+++ net/rtorrent/patches/patch-src_command__local.cc
@@ -0,0 +1,183 @@
+$NetBSD$
+
+--- src/command_local.cc.orig 2012-04-18 07:59:16.000000000 +0000
++++ src/command_local.cc
+@@ -65,6 +65,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ typedef torrent::ChunkManager CM_t;
+ typedef torrent::FileManager FM_t;
+
+@@ -326,8 +336,8 @@ initialize_command_local() {
+ core::DownloadList* dList = control->core()->download_list();
+ core::DownloadStore* dStore = control->core()->download_store();
+
+- CMD2_ANY ("system.hostname", tr1::bind(&system_hostname));
+- CMD2_ANY ("system.pid", tr1::bind(&getpid));
++ CMD2_ANY ("system.hostname", bind(&system_hostname));
++ CMD2_ANY ("system.pid", bind(&getpid));
+
+ CMD2_VAR_C_STRING("system.api_version", (int64_t)API_VERSION);
+ CMD2_VAR_C_STRING("system.client_version", PACKAGE_VERSION);
+@@ -337,54 +347,54 @@ initialize_command_local() {
+ CMD2_VAR_VALUE ("system.file.split_size", -1);
+ CMD2_VAR_STRING ("system.file.split_suffix", ".part");
+
+- CMD2_ANY ("system.file_status_cache.size",
tr1::bind(&utils::FileStatusCache::size,
++ CMD2_ANY ("system.file_status_cache.size",
bind(&utils::FileStatusCache::size,
+
(utils::FileStatusCache::base_type*)control->core()->file_status_cache()));
+- CMD2_ANY_V ("system.file_status_cache.prune",
tr1::bind(&utils::FileStatusCache::prune,
control->core()->file_status_cache()));
++ CMD2_ANY_V ("system.file_status_cache.prune",
bind(&utils::FileStatusCache::prune, control->core()->file_status_cache()));
+
+ CMD2_VAR_BOOL ("file.prioritize_toc", 0);
+ CMD2_VAR_LIST ("file.prioritize_toc.first");
+ CMD2_VAR_LIST ("file.prioritize_toc.last");
+
+- CMD2_ANY ("system.files.opened_counter",
tr1::bind(&FM_t::files_opened_counter, fileManager));
+- CMD2_ANY ("system.files.closed_counter",
tr1::bind(&FM_t::files_closed_counter, fileManager));
+- CMD2_ANY ("system.files.failed_counter",
tr1::bind(&FM_t::files_failed_counter, fileManager));
+-
+- CMD2_ANY ("system.time",
tr1::bind(&rak::timer::seconds, &cachedTime));
+- CMD2_ANY ("system.time_seconds",
tr1::bind(&rak::timer::current_seconds));
+- CMD2_ANY ("system.time_usec",
tr1::bind(&rak::timer::current_usec));
+-
+- CMD2_ANY_VALUE_V ("system.umask.set", tr1::bind(&umask,
tr1::placeholders::_2));
+-
+- CMD2_ANY ("system.cwd",
tr1::bind(&system_get_cwd));
+- CMD2_ANY_STRING ("system.cwd.set",
tr1::bind(&system_set_cwd, tr1::placeholders::_2));
+-
+- CMD2_ANY ("pieces.sync.always_safe",
tr1::bind(&CM_t::safe_sync, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.sync.always_safe.set",
tr1::bind(&CM_t::set_safe_sync, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.sync.safe_free_diskspace",
tr1::bind(&CM_t::safe_free_diskspace, chunkManager));
+- CMD2_ANY ("pieces.sync.timeout",
tr1::bind(&CM_t::timeout_sync, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.sync.timeout.set",
tr1::bind(&CM_t::set_timeout_sync, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.sync.timeout_safe",
tr1::bind(&CM_t::timeout_safe_sync, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.sync.timeout_safe.set",
tr1::bind(&CM_t::set_timeout_safe_sync, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.sync.queue_size",
tr1::bind(&CM_t::sync_queue_size, chunkManager));
+-
+- CMD2_ANY ("pieces.preload.type",
tr1::bind(&CM_t::preload_type, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.preload.type.set",
tr1::bind(&CM_t::set_preload_type, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.preload.min_size",
tr1::bind(&CM_t::preload_min_size, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.preload.min_size.set",
tr1::bind(&CM_t::set_preload_min_size, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.preload.min_rate",
tr1::bind(&CM_t::preload_required_rate, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.preload.min_rate.set",
tr1::bind(&CM_t::set_preload_required_rate, chunkManager,
tr1::placeholders::_2));
+-
+- CMD2_ANY ("pieces.memory.current",
tr1::bind(&CM_t::memory_usage, chunkManager));
+- CMD2_ANY ("pieces.memory.sync_queue",
tr1::bind(&CM_t::sync_queue_memory_usage, chunkManager));
+- CMD2_ANY ("pieces.memory.block_count",
tr1::bind(&CM_t::memory_block_count, chunkManager));
+- CMD2_ANY ("pieces.memory.max",
tr1::bind(&CM_t::max_memory_usage, chunkManager));
+- CMD2_ANY_VALUE_V ("pieces.memory.max.set",
tr1::bind(&CM_t::set_max_memory_usage, chunkManager, tr1::placeholders::_2));
+- CMD2_ANY ("pieces.stats_preloaded",
tr1::bind(&CM_t::stats_preloaded, chunkManager));
+- CMD2_ANY ("pieces.stats_not_preloaded",
tr1::bind(&CM_t::stats_not_preloaded, chunkManager));
++ CMD2_ANY ("system.files.opened_counter",
bind(&FM_t::files_opened_counter, fileManager));
++ CMD2_ANY ("system.files.closed_counter",
bind(&FM_t::files_closed_counter, fileManager));
++ CMD2_ANY ("system.files.failed_counter",
bind(&FM_t::files_failed_counter, fileManager));
++
++ CMD2_ANY ("system.time",
bind(&rak::timer::seconds, &cachedTime));
++ CMD2_ANY ("system.time_seconds",
bind(&rak::timer::current_seconds));
++ CMD2_ANY ("system.time_usec",
bind(&rak::timer::current_usec));
++
++ CMD2_ANY_VALUE_V ("system.umask.set", bind(&umask,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("system.cwd", bind(&system_get_cwd));
++ CMD2_ANY_STRING ("system.cwd.set", bind(&system_set_cwd,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("pieces.sync.always_safe", bind(&CM_t::safe_sync,
chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.sync.always_safe.set",
bind(&CM_t::set_safe_sync, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.sync.safe_free_diskspace",
bind(&CM_t::safe_free_diskspace, chunkManager));
++ CMD2_ANY ("pieces.sync.timeout",
bind(&CM_t::timeout_sync, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.sync.timeout.set",
bind(&CM_t::set_timeout_sync, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.sync.timeout_safe",
bind(&CM_t::timeout_safe_sync, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.sync.timeout_safe.set",
bind(&CM_t::set_timeout_safe_sync, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.sync.queue_size",
bind(&CM_t::sync_queue_size, chunkManager));
++
++ CMD2_ANY ("pieces.preload.type",
bind(&CM_t::preload_type, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.preload.type.set",
bind(&CM_t::set_preload_type, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.preload.min_size",
bind(&CM_t::preload_min_size, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.preload.min_size.set",
bind(&CM_t::set_preload_min_size, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.preload.min_rate",
bind(&CM_t::preload_required_rate, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.preload.min_rate.set",
bind(&CM_t::set_preload_required_rate, chunkManager, STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("pieces.memory.current",
bind(&CM_t::memory_usage, chunkManager));
++ CMD2_ANY ("pieces.memory.sync_queue",
bind(&CM_t::sync_queue_memory_usage, chunkManager));
++ CMD2_ANY ("pieces.memory.block_count",
bind(&CM_t::memory_block_count, chunkManager));
++ CMD2_ANY ("pieces.memory.max",
bind(&CM_t::max_memory_usage, chunkManager));
++ CMD2_ANY_VALUE_V ("pieces.memory.max.set",
bind(&CM_t::set_max_memory_usage, chunkManager, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("pieces.stats_preloaded",
bind(&CM_t::stats_preloaded, chunkManager));
++ CMD2_ANY ("pieces.stats_not_preloaded",
bind(&CM_t::stats_not_preloaded, chunkManager));
+
+- CMD2_ANY ("pieces.stats.total_size",
tr1::bind(&apply_pieces_stats_total_size));
++ CMD2_ANY ("pieces.stats.total_size",
bind(&apply_pieces_stats_total_size));
+
+- CMD2_ANY ("pieces.hash.queue_size",
tr1::bind(&torrent::hash_queue_size));
++ CMD2_ANY ("pieces.hash.queue_size",
bind(&torrent::hash_queue_size));
+ CMD2_VAR_BOOL ("pieces.hash.on_completion", true);
+
+ CMD2_VAR_STRING ("directory.default", "./");
+@@ -393,13 +403,13 @@ initialize_command_local() {
+ CMD2_VAR_BOOL ("session.use_lock", true);
+ CMD2_VAR_BOOL ("session.on_completion", true);
+
+- CMD2_ANY ("session.path",
tr1::bind(&core::DownloadStore::path, dStore));
+- CMD2_ANY_STRING_V("session.path.set",
tr1::bind(&core::DownloadStore::set_path, dStore, tr1::placeholders::_2));
++ CMD2_ANY ("session.path",
bind(&core::DownloadStore::path, dStore));
++ CMD2_ANY_STRING_V("session.path.set",
bind(&core::DownloadStore::set_path, dStore, STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_V ("session.save",
tr1::bind(&core::DownloadList::session_save, dList));
++ CMD2_ANY_V ("session.save",
bind(&core::DownloadList::session_save, dList));
+
+ #define CMD2_EXECUTE(key, flags) \
+- CMD2_ANY(key, tr1::bind(&rpc::ExecFile::execute_object, &rpc::execFile,
tr1::placeholders::_2, flags));
++ CMD2_ANY(key, bind(&rpc::ExecFile::execute_object, &rpc::execFile,
STD_PLACEHOLDERS::_2, flags));
+
+ CMD2_EXECUTE ("execute2",
rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_throw);
+ CMD2_EXECUTE ("execute.throw",
rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_throw);
+@@ -413,25 +423,25 @@ initialize_command_local() {
+ CMD2_EXECUTE ("execute.capture", rpc::ExecFile::flag_throw |
rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_capture);
+ CMD2_EXECUTE ("execute.capture_nothrow",
rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_capture);
+
+- CMD2_ANY_LIST ("log.open_file", tr1::bind(&apply_log_open_file,
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("log.add_output", tr1::bind(&apply_log_add_output,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("log.open_file", bind(&apply_log_open_file,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("log.add_output", bind(&apply_log_add_output,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_STRING ("log.execute", tr1::bind(&apply_log,
tr1::placeholders::_2, 0));
+- CMD2_ANY_STRING ("log.vmmap.dump", tr1::bind(&log_vmmap_dump,
tr1::placeholders::_2));
+- CMD2_ANY_STRING_V("log.xmlrpc",
tr1::bind(&ThreadWorker::set_xmlrpc_log, worker_thread, tr1::placeholders::_2));
+- CMD2_ANY_LIST ("log.libtorrent", tr1::bind(&apply_log_libtorrent,
tr1::placeholders::_2));
++ CMD2_ANY_STRING ("log.execute", bind(&apply_log, STD_PLACEHOLDERS::_2,
0));
++ CMD2_ANY_STRING ("log.vmmap.dump", bind(&log_vmmap_dump,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING_V("log.xmlrpc", bind(&ThreadWorker::set_xmlrpc_log,
worker_thread, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("log.libtorrent", bind(&apply_log_libtorrent,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST ("file.append", tr1::bind(&cmd_file_append,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("file.append", bind(&cmd_file_append,
STD_PLACEHOLDERS::_2));
+
+ // TODO: Convert to new command types:
+ *rpc::command_base::argument(0) = "placeholder.0";
+ *rpc::command_base::argument(1) = "placeholder.1";
+ *rpc::command_base::argument(2) = "placeholder.2";
+ *rpc::command_base::argument(3) = "placeholder.3";
+- CMD2_ANY_P("argument.0", tr1::bind(&rpc::command_base::argument_ref, 0));
+- CMD2_ANY_P("argument.1", tr1::bind(&rpc::command_base::argument_ref, 1));
+- CMD2_ANY_P("argument.2", tr1::bind(&rpc::command_base::argument_ref, 2));
+- CMD2_ANY_P("argument.3", tr1::bind(&rpc::command_base::argument_ref, 3));
++ CMD2_ANY_P("argument.0", bind(&rpc::command_base::argument_ref, 0));
++ CMD2_ANY_P("argument.1", bind(&rpc::command_base::argument_ref, 1));
++ CMD2_ANY_P("argument.2", bind(&rpc::command_base::argument_ref, 2));
++ CMD2_ANY_P("argument.3", bind(&rpc::command_base::argument_ref, 3));
+
+- CMD2_ANY_LIST ("group.insert", tr1::bind(&group_insert,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("group.insert", bind(&group_insert, STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__network.cc
Index: net/rtorrent/patches/patch-src_command__network.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__network.cc
+++ net/rtorrent/patches/patch-src_command__network.cc
@@ -0,0 +1,146 @@
+$NetBSD$
+
+--- src/command_network.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_network.cc
+@@ -62,7 +62,15 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
+-namespace tr1 { using namespace std::tr1; }
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
+
+ torrent::Object
+ apply_encryption(const torrent::Object::list_type& args) {
+@@ -126,10 +134,10 @@ xmlrpc_find_peer(core::Download* downloa
+ void
+ initialize_xmlrpc() {
+ rpc::xmlrpc.initialize();
+- rpc::xmlrpc.slot_find_download() =
tr1::bind(&core::DownloadList::find_hex_ptr, control->core()->download_list(),
tr1::placeholders::_1);
+- rpc::xmlrpc.slot_find_file() = tr1::bind(&xmlrpc_find_file,
tr1::placeholders::_1, tr1::placeholders::_2);
+- rpc::xmlrpc.slot_find_tracker() = tr1::bind(&xmlrpc_find_tracker,
tr1::placeholders::_1, tr1::placeholders::_2);
+- rpc::xmlrpc.slot_find_peer() = tr1::bind(&xmlrpc_find_peer,
tr1::placeholders::_1, tr1::placeholders::_2);
++ rpc::xmlrpc.slot_find_download() = bind(&core::DownloadList::find_hex_ptr,
control->core()->download_list(), STD_PLACEHOLDERS::_1);
++ rpc::xmlrpc.slot_find_file() = bind(&xmlrpc_find_file,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2);
++ rpc::xmlrpc.slot_find_tracker() = bind(&xmlrpc_find_tracker,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2);
++ rpc::xmlrpc.slot_find_peer() = bind(&xmlrpc_find_peer,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2);
+
+ unsigned int count = 0;
+
+@@ -236,23 +244,23 @@ initialize_command_network() {
+ torrent::FileManager* fileManager = torrent::file_manager();
+ core::CurlStack* httpStack = control->core()->http_stack();
+
+- CMD2_ANY ("strings.connection_type",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
+- CMD2_ANY ("strings.encryption",
tr1::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
++ CMD2_ANY ("strings.connection_type",
bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
++ CMD2_ANY ("strings.encryption",
bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
+
+ CMD2_VAR_BOOL ("log.handshake", false);
+
+- // CMD2_ANY_STRING ("encoding_list", tr1::bind(&apply_encoding_list,
tr1::placeholders::_2));
+- CMD2_ANY_STRING ("encoding.add", tr1::bind(&apply_encoding_list,
tr1::placeholders::_2));
++ // CMD2_ANY_STRING ("encoding_list", bind(&apply_encoding_list,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING ("encoding.add", bind(&apply_encoding_list,
STD_PLACEHOLDERS::_2));
+
+ // Isn't port_open used?
+ CMD2_VAR_BOOL ("network.port_open", true);
+ CMD2_VAR_BOOL ("network.port_random", true);
+ CMD2_VAR_STRING ("network.port_range", "6881-6999");
+
+- CMD2_ANY ("network.listen.port",
tr1::bind(&torrent::ConnectionManager::listen_port, cm));
++ CMD2_ANY ("network.listen.port",
bind(&torrent::ConnectionManager::listen_port, cm));
+
+ CMD2_VAR_BOOL ("protocol.pex", true);
+- CMD2_ANY_LIST ("protocol.encryption.set", tr1::bind(&apply_encryption,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("protocol.encryption.set", bind(&apply_encryption,
STD_PLACEHOLDERS::_2));
+
+ CMD2_VAR_STRING ("protocol.connection.leech", "leech");
+ CMD2_VAR_STRING ("protocol.connection.seed", "seed");
+@@ -262,43 +270,43 @@ initialize_command_network() {
+ CMD2_VAR_STRING ("protocol.choke_heuristics.down.leech", "download_leech");
+ CMD2_VAR_STRING ("protocol.choke_heuristics.down.seed", "download_leech");
+
+- CMD2_ANY ("network.http.capath",
tr1::bind(&core::CurlStack::http_capath, httpStack));
+- CMD2_ANY_STRING_V("network.http.capath.set",
tr1::bind(&core::CurlStack::set_http_capath, httpStack, tr1::placeholders::_2));
+- CMD2_ANY ("network.http.cacert",
tr1::bind(&core::CurlStack::http_cacert, httpStack));
+- CMD2_ANY_STRING_V("network.http.cacert.set",
tr1::bind(&core::CurlStack::set_http_cacert, httpStack, tr1::placeholders::_2));
+- CMD2_ANY ("network.http.proxy_address",
tr1::bind(&core::CurlStack::http_proxy, httpStack));
+- CMD2_ANY_STRING_V("network.http.proxy_address.set",
tr1::bind(&core::CurlStack::set_http_proxy, httpStack, tr1::placeholders::_2));
+- CMD2_ANY ("network.http.max_open",
tr1::bind(&core::CurlStack::max_active, httpStack));
+- CMD2_ANY_VALUE_V ("network.http.max_open.set",
tr1::bind(&core::CurlStack::set_max_active, httpStack, tr1::placeholders::_2));
+- CMD2_ANY ("network.http.ssl_verify_peer",
tr1::bind(&core::CurlStack::ssl_verify_peer, httpStack));
+- CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set",
tr1::bind(&core::CurlStack::set_ssl_verify_peer, httpStack,
tr1::placeholders::_2));
+- CMD2_ANY ("network.http.dns_cache_timeout",
tr1::bind(&core::CurlStack::dns_timeout, httpStack));
+- CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set",
tr1::bind(&core::CurlStack::set_dns_timeout, httpStack, tr1::placeholders::_2));
+-
+- CMD2_ANY ("network.send_buffer.size",
tr1::bind(&torrent::ConnectionManager::send_buffer_size, cm));
+- CMD2_ANY_VALUE_V ("network.send_buffer.size.set",
tr1::bind(&torrent::ConnectionManager::set_send_buffer_size, cm,
tr1::placeholders::_2));
+- CMD2_ANY ("network.receive_buffer.size",
tr1::bind(&torrent::ConnectionManager::receive_buffer_size, cm));
+- CMD2_ANY_VALUE_V ("network.receive_buffer.size.set",
tr1::bind(&torrent::ConnectionManager::set_receive_buffer_size, cm,
tr1::placeholders::_2));
+- CMD2_ANY_STRING ("network.tos.set", tr1::bind(&apply_tos,
tr1::placeholders::_2));
+-
+- CMD2_ANY ("network.bind_address",
tr1::bind(&core::Manager::bind_address, control->core()));
+- CMD2_ANY_STRING_V("network.bind_address.set",
tr1::bind(&core::Manager::set_bind_address, control->core(),
tr1::placeholders::_2));
+- CMD2_ANY ("network.local_address",
tr1::bind(&core::Manager::local_address, control->core()));
+- CMD2_ANY_STRING_V("network.local_address.set",
tr1::bind(&core::Manager::set_local_address, control->core(),
tr1::placeholders::_2));
+- CMD2_ANY ("network.proxy_address",
tr1::bind(&core::Manager::proxy_address, control->core()));
+- CMD2_ANY_STRING_V("network.proxy_address.set",
tr1::bind(&core::Manager::set_proxy_address, control->core(),
tr1::placeholders::_2));
+-
+- CMD2_ANY ("network.max_open_files",
tr1::bind(&torrent::FileManager::max_open_files, fileManager));
+- CMD2_ANY_VALUE_V ("network.max_open_files.set",
tr1::bind(&torrent::FileManager::set_max_open_files, fileManager,
tr1::placeholders::_2));
+- CMD2_ANY ("network.open_sockets",
tr1::bind(&torrent::ConnectionManager::size, cm));
+- CMD2_ANY ("network.max_open_sockets",
tr1::bind(&torrent::ConnectionManager::max_size, cm));
+- CMD2_ANY_VALUE_V ("network.max_open_sockets.set",
tr1::bind(&torrent::ConnectionManager::set_max_size, cm,
tr1::placeholders::_2));
++ CMD2_ANY ("network.http.capath",
bind(&core::CurlStack::http_capath, httpStack));
++ CMD2_ANY_STRING_V("network.http.capath.set",
bind(&core::CurlStack::set_http_capath, httpStack, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.http.cacert",
bind(&core::CurlStack::http_cacert, httpStack));
++ CMD2_ANY_STRING_V("network.http.cacert.set",
bind(&core::CurlStack::set_http_cacert, httpStack, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.http.proxy_address",
bind(&core::CurlStack::http_proxy, httpStack));
++ CMD2_ANY_STRING_V("network.http.proxy_address.set",
bind(&core::CurlStack::set_http_proxy, httpStack, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.http.max_open",
bind(&core::CurlStack::max_active, httpStack));
++ CMD2_ANY_VALUE_V ("network.http.max_open.set",
bind(&core::CurlStack::set_max_active, httpStack, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.http.ssl_verify_peer",
bind(&core::CurlStack::ssl_verify_peer, httpStack));
++ CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set",
bind(&core::CurlStack::set_ssl_verify_peer, httpStack, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.http.dns_cache_timeout",
bind(&core::CurlStack::dns_timeout, httpStack));
++ CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set",
bind(&core::CurlStack::set_dns_timeout, httpStack, STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("network.send_buffer.size",
bind(&torrent::ConnectionManager::send_buffer_size, cm));
++ CMD2_ANY_VALUE_V ("network.send_buffer.size.set",
bind(&torrent::ConnectionManager::set_send_buffer_size, cm,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.receive_buffer.size",
bind(&torrent::ConnectionManager::receive_buffer_size, cm));
++ CMD2_ANY_VALUE_V ("network.receive_buffer.size.set",
bind(&torrent::ConnectionManager::set_receive_buffer_size, cm,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING ("network.tos.set", bind(&apply_tos,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("network.bind_address",
bind(&core::Manager::bind_address, control->core()));
++ CMD2_ANY_STRING_V("network.bind_address.set",
bind(&core::Manager::set_bind_address, control->core(), STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.local_address",
bind(&core::Manager::local_address, control->core()));
++ CMD2_ANY_STRING_V("network.local_address.set",
bind(&core::Manager::set_local_address, control->core(), STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.proxy_address",
bind(&core::Manager::proxy_address, control->core()));
++ CMD2_ANY_STRING_V("network.proxy_address.set",
bind(&core::Manager::set_proxy_address, control->core(), STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY ("network.max_open_files",
bind(&torrent::FileManager::max_open_files, fileManager));
++ CMD2_ANY_VALUE_V ("network.max_open_files.set",
bind(&torrent::FileManager::set_max_open_files, fileManager,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.open_sockets",
bind(&torrent::ConnectionManager::size, cm));
++ CMD2_ANY ("network.max_open_sockets",
bind(&torrent::ConnectionManager::max_size, cm));
++ CMD2_ANY_VALUE_V ("network.max_open_sockets.set",
bind(&torrent::ConnectionManager::set_max_size, cm, STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_STRING ("network.scgi.open_port", tr1::bind(&apply_scgi,
tr1::placeholders::_2, 1));
+- CMD2_ANY_STRING ("network.scgi.open_local", tr1::bind(&apply_scgi,
tr1::placeholders::_2, 2));
++ CMD2_ANY_STRING ("network.scgi.open_port", bind(&apply_scgi,
STD_PLACEHOLDERS::_2, 1));
++ CMD2_ANY_STRING ("network.scgi.open_local", bind(&apply_scgi,
STD_PLACEHOLDERS::_2, 2));
+ CMD2_VAR_BOOL ("network.scgi.dont_route", false);
+
+- CMD2_ANY_STRING ("network.xmlrpc.dialect.set",
tr1::bind(&apply_xmlrpc_dialect, tr1::placeholders::_2));
+- CMD2_ANY ("network.xmlrpc.size_limit",
tr1::bind(&rpc::XmlRpc::size_limit));
+- CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set",
tr1::bind(&rpc::XmlRpc::set_size_limit, tr1::placeholders::_2));
++ CMD2_ANY_STRING ("network.xmlrpc.dialect.set",
bind(&apply_xmlrpc_dialect, STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("network.xmlrpc.size_limit",
bind(&rpc::XmlRpc::size_limit));
++ CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set",
bind(&rpc::XmlRpc::set_size_limit, STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__peer.cc
Index: net/rtorrent/patches/patch-src_command__peer.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__peer.cc
+++ net/rtorrent/patches/patch-src_command__peer.cc
@@ -0,0 +1,91 @@
+$NetBSD$
+
+--- src/command_peer.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_peer.cc
+@@ -53,6 +53,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ torrent::Object
+ retrieve_p_id(torrent::Peer* peer) {
+ const torrent::HashString* hashString = &peer->id();
+@@ -97,37 +107,37 @@ retrieve_p_completed_percent(torrent::Pe
+
+ void
+ initialize_command_peer() {
+- CMD2_PEER("p.id", tr1::bind(&retrieve_p_id,
tr1::placeholders::_1));
+- CMD2_PEER("p.id_html", tr1::bind(&retrieve_p_id_html,
tr1::placeholders::_1));
+- CMD2_PEER("p.client_version", tr1::bind(&retrieve_p_client_version,
tr1::placeholders::_1));
+-
+- CMD2_PEER("p.options_str", tr1::bind(&retrieve_p_options_str,
tr1::placeholders::_1));
+-
+- CMD2_PEER("p.is_encrypted", tr1::bind(&torrent::Peer::is_encrypted,
tr1::placeholders::_1));
+- CMD2_PEER("p.is_incoming", tr1::bind(&torrent::Peer::is_incoming,
tr1::placeholders::_1));
+- CMD2_PEER("p.is_obfuscated", tr1::bind(&torrent::Peer::is_obfuscated,
tr1::placeholders::_1));
+- CMD2_PEER("p.is_snubbed", tr1::bind(&torrent::Peer::is_snubbed,
tr1::placeholders::_1));
+-
+- CMD2_PEER("p.is_unwanted", tr1::bind(&torrent::PeerInfo::is_unwanted,
tr1::bind(&torrent::Peer::peer_info, tr1::placeholders::_1)));
+- CMD2_PEER("p.is_preferred",
tr1::bind(&torrent::PeerInfo::is_preferred,
tr1::bind(&torrent::Peer::peer_info, tr1::placeholders::_1)));
+-
+- CMD2_PEER("p.address", tr1::bind(&retrieve_p_address,
tr1::placeholders::_1));
+- CMD2_PEER("p.port", tr1::bind(&retrieve_p_port,
tr1::placeholders::_1));
+-
+- CMD2_PEER("p.completed_percent", tr1::bind(&retrieve_p_completed_percent,
tr1::placeholders::_1));
+-
+- CMD2_PEER("p.up_rate", tr1::bind(&torrent::Rate::rate,
tr1::bind(&torrent::Peer::up_rate, tr1::placeholders::_1)));
+- CMD2_PEER("p.up_total", tr1::bind(&torrent::Rate::total,
tr1::bind(&torrent::Peer::up_rate, tr1::placeholders::_1)));
+- CMD2_PEER("p.down_rate", tr1::bind(&torrent::Rate::rate,
tr1::bind(&torrent::Peer::down_rate, tr1::placeholders::_1)));
+- CMD2_PEER("p.down_total", tr1::bind(&torrent::Rate::total,
tr1::bind(&torrent::Peer::down_rate, tr1::placeholders::_1)));
+- CMD2_PEER("p.peer_rate", tr1::bind(&torrent::Rate::rate,
tr1::bind(&torrent::Peer::peer_rate, tr1::placeholders::_1)));
+- CMD2_PEER("p.peer_total", tr1::bind(&torrent::Rate::total,
tr1::bind(&torrent::Peer::peer_rate, tr1::placeholders::_1)));
+-
+- CMD2_PEER ("p.snubbed", tr1::bind(&torrent::Peer::is_snubbed,
tr1::placeholders::_1));
+- CMD2_PEER_VALUE_V("p.snubbed.set", tr1::bind(&torrent::Peer::set_snubbed,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_PEER ("p.banned", tr1::bind(&torrent::Peer::is_banned,
tr1::placeholders::_1));
+- CMD2_PEER_VALUE_V("p.banned.set", tr1::bind(&torrent::Peer::set_banned,
tr1::placeholders::_1, tr1::placeholders::_2));
++ CMD2_PEER("p.id", bind(&retrieve_p_id,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.id_html", bind(&retrieve_p_id_html,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.client_version", bind(&retrieve_p_client_version,
STD_PLACEHOLDERS::_1));
++
++ CMD2_PEER("p.options_str", bind(&retrieve_p_options_str,
STD_PLACEHOLDERS::_1));
++
++ CMD2_PEER("p.is_encrypted", bind(&torrent::Peer::is_encrypted,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.is_incoming", bind(&torrent::Peer::is_incoming,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.is_obfuscated", bind(&torrent::Peer::is_obfuscated,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.is_snubbed", bind(&torrent::Peer::is_snubbed,
STD_PLACEHOLDERS::_1));
++
++ CMD2_PEER("p.is_unwanted", bind(&torrent::PeerInfo::is_unwanted,
bind(&torrent::Peer::peer_info, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.is_preferred", bind(&torrent::PeerInfo::is_preferred,
bind(&torrent::Peer::peer_info, STD_PLACEHOLDERS::_1)));
++
++ CMD2_PEER("p.address", bind(&retrieve_p_address,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER("p.port", bind(&retrieve_p_port,
STD_PLACEHOLDERS::_1));
++
++ CMD2_PEER("p.completed_percent", bind(&retrieve_p_completed_percent,
STD_PLACEHOLDERS::_1));
++
++ CMD2_PEER("p.up_rate", bind(&torrent::Rate::rate,
bind(&torrent::Peer::up_rate, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.up_total", bind(&torrent::Rate::total,
bind(&torrent::Peer::up_rate, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.down_rate", bind(&torrent::Rate::rate,
bind(&torrent::Peer::down_rate, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.down_total", bind(&torrent::Rate::total,
bind(&torrent::Peer::down_rate, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.peer_rate", bind(&torrent::Rate::rate,
bind(&torrent::Peer::peer_rate, STD_PLACEHOLDERS::_1)));
++ CMD2_PEER("p.peer_total", bind(&torrent::Rate::total,
bind(&torrent::Peer::peer_rate, STD_PLACEHOLDERS::_1)));
++
++ CMD2_PEER ("p.snubbed", bind(&torrent::Peer::is_snubbed,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER_VALUE_V("p.snubbed.set", bind(&torrent::Peer::set_snubbed,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_PEER ("p.banned", bind(&torrent::Peer::is_banned,
STD_PLACEHOLDERS::_1));
++ CMD2_PEER_VALUE_V("p.banned.set", bind(&torrent::Peer::set_banned,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+- CMD2_PEER_V("p.disconnect", tr1::bind(&torrent::Peer::disconnect,
tr1::placeholders::_1, 0));
+- CMD2_PEER_V("p.disconnect_delayed", tr1::bind(&torrent::Peer::disconnect,
tr1::placeholders::_1, torrent::ConnectionList::disconnect_delayed));
++ CMD2_PEER_V("p.disconnect", bind(&torrent::Peer::disconnect,
STD_PLACEHOLDERS::_1, 0));
++ CMD2_PEER_V("p.disconnect_delayed", bind(&torrent::Peer::disconnect,
STD_PLACEHOLDERS::_1, torrent::ConnectionList::disconnect_delayed));
+ }
ADDED net/rtorrent/patches/patch-src_command__scheduler.cc
Index: net/rtorrent/patches/patch-src_command__scheduler.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__scheduler.cc
+++ net/rtorrent/patches/patch-src_command__scheduler.cc
@@ -0,0 +1,32 @@
+$NetBSD$
+
+--- src/command_scheduler.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_scheduler.cc
+@@ -48,6 +48,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ torrent::Object
+ cmd_scheduler_simple_added(core::Download* download) {
+ unsigned int numActive =
(*control->view_manager()->find("active"))->size_visible();
+@@ -115,7 +125,7 @@ void
+ initialize_command_scheduler() {
+ CMD2_VAR_VALUE("scheduler.max_active", int64_t(-1));
+
+- CMD2_DL("scheduler.simple.added", tr1::bind(&cmd_scheduler_simple_added,
tr1::placeholders::_1));
+- CMD2_DL("scheduler.simple.removed",
tr1::bind(&cmd_scheduler_simple_removed, tr1::placeholders::_1));
+- CMD2_DL("scheduler.simple.update", tr1::bind(&cmd_scheduler_simple_update,
tr1::placeholders::_1));
++ CMD2_DL("scheduler.simple.added", bind(&cmd_scheduler_simple_added,
STD_PLACEHOLDERS::_1));
++ CMD2_DL("scheduler.simple.removed", bind(&cmd_scheduler_simple_removed,
STD_PLACEHOLDERS::_1));
++ CMD2_DL("scheduler.simple.update", bind(&cmd_scheduler_simple_update,
STD_PLACEHOLDERS::_1));
+ }
ADDED net/rtorrent/patches/patch-src_command__throttle.cc
Index: net/rtorrent/patches/patch-src_command__throttle.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__throttle.cc
+++ net/rtorrent/patches/patch-src_command__throttle.cc
@@ -0,0 +1,86 @@
+$NetBSD$
+
+--- src/command_throttle.cc.orig 2012-04-15 15:43:20.000000000 +0000
++++ src/command_throttle.cc
+@@ -51,6 +51,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ std::pair<uint32_t, uint32_t>
+ parse_address_range(const torrent::Object::list_type& args,
torrent::Object::list_type::const_iterator itr) {
+ unsigned int prefixWidth, ret;
+@@ -173,8 +183,8 @@ throttle_update(const char* variable, in
+
+ void
+ initialize_command_throttle() {
+- CMD2_ANY ("throttle.unchoked_uploads",
tr1::bind(&torrent::ResourceManager::currently_upload_unchoked,
torrent::resource_manager()));
+- CMD2_ANY ("throttle.unchoked_downloads",
tr1::bind(&torrent::ResourceManager::currently_download_unchoked,
torrent::resource_manager()));
++ CMD2_ANY ("throttle.unchoked_uploads",
bind(&torrent::ResourceManager::currently_upload_unchoked,
torrent::resource_manager()));
++ CMD2_ANY ("throttle.unchoked_downloads",
bind(&torrent::ResourceManager::currently_download_unchoked,
torrent::resource_manager()));
+
+ CMD2_VAR_VALUE ("throttle.min_peers.normal", 100);
+ CMD2_VAR_VALUE ("throttle.max_peers.normal", 200);
+@@ -196,31 +206,31 @@ initialize_command_throttle() {
+ CMD2_REDIRECT_GENERIC("throttle.max_downloads.div",
"throttle.max_downloads.div._val");
+ CMD2_REDIRECT_GENERIC("throttle.max_downloads.global",
"throttle.max_downloads.global._val");
+
+- CMD2_ANY_VALUE ("throttle.max_uploads.div.set",
tr1::bind(&throttle_update, "throttle.max_uploads.div._val.set",
tr1::placeholders::_2));
+- CMD2_ANY_VALUE ("throttle.max_uploads.global.set",
tr1::bind(&throttle_update, "throttle.max_uploads.global._val.set",
tr1::placeholders::_2));
+- CMD2_ANY_VALUE ("throttle.max_downloads.div.set",
tr1::bind(&throttle_update, "throttle.max_downloads.div._val.set",
tr1::placeholders::_2));
+- CMD2_ANY_VALUE ("throttle.max_downloads.global.set",
tr1::bind(&throttle_update, "throttle.max_downloads.global._val.set",
tr1::placeholders::_2));
++ CMD2_ANY_VALUE ("throttle.max_uploads.div.set",
bind(&throttle_update, "throttle.max_uploads.div._val.set",
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE ("throttle.max_uploads.global.set",
bind(&throttle_update, "throttle.max_uploads.global._val.set",
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE ("throttle.max_downloads.div.set",
bind(&throttle_update, "throttle.max_downloads.div._val.set",
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE ("throttle.max_downloads.global.set",
bind(&throttle_update, "throttle.max_downloads.global._val.set",
STD_PLACEHOLDERS::_2));
+
+ // TODO: Move the logic into some libtorrent function.
+- CMD2_ANY ("throttle.global_up.rate",
tr1::bind(&torrent::Rate::rate, torrent::up_rate()));
+- CMD2_ANY ("throttle.global_up.total",
tr1::bind(&torrent::Rate::total, torrent::up_rate()));
+- CMD2_ANY ("throttle.global_up.max_rate",
tr1::bind(&torrent::Throttle::max_rate, torrent::up_throttle_global()));
+- CMD2_ANY_VALUE_V ("throttle.global_up.max_rate.set",
tr1::bind(&ui::Root::set_up_throttle_i64, control->ui(),
tr1::placeholders::_2));
+- CMD2_ANY_VALUE_KB("throttle.global_up.max_rate.set_kb",
tr1::bind(&ui::Root::set_up_throttle_i64, control->ui(),
tr1::placeholders::_2));
+- CMD2_ANY ("throttle.global_down.rate",
tr1::bind(&torrent::Rate::rate, torrent::down_rate()));
+- CMD2_ANY ("throttle.global_down.total",
tr1::bind(&torrent::Rate::total, torrent::down_rate()));
+- CMD2_ANY ("throttle.global_down.max_rate",
tr1::bind(&torrent::Throttle::max_rate, torrent::down_throttle_global()));
+- CMD2_ANY_VALUE_V ("throttle.global_down.max_rate.set",
tr1::bind(&ui::Root::set_down_throttle_i64, control->ui(),
tr1::placeholders::_2));
+- CMD2_ANY_VALUE_KB("throttle.global_down.max_rate.set_kb",
tr1::bind(&ui::Root::set_down_throttle_i64, control->ui(),
tr1::placeholders::_2));
++ CMD2_ANY ("throttle.global_up.rate",
bind(&torrent::Rate::rate, torrent::up_rate()));
++ CMD2_ANY ("throttle.global_up.total",
bind(&torrent::Rate::total, torrent::up_rate()));
++ CMD2_ANY ("throttle.global_up.max_rate",
bind(&torrent::Throttle::max_rate, torrent::up_throttle_global()));
++ CMD2_ANY_VALUE_V ("throttle.global_up.max_rate.set",
bind(&ui::Root::set_up_throttle_i64, control->ui(), STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE_KB("throttle.global_up.max_rate.set_kb",
bind(&ui::Root::set_up_throttle_i64, control->ui(), STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("throttle.global_down.rate",
bind(&torrent::Rate::rate, torrent::down_rate()));
++ CMD2_ANY ("throttle.global_down.total",
bind(&torrent::Rate::total, torrent::down_rate()));
++ CMD2_ANY ("throttle.global_down.max_rate",
bind(&torrent::Throttle::max_rate, torrent::down_throttle_global()));
++ CMD2_ANY_VALUE_V ("throttle.global_down.max_rate.set",
bind(&ui::Root::set_down_throttle_i64, control->ui(), STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE_KB("throttle.global_down.max_rate.set_kb",
bind(&ui::Root::set_down_throttle_i64, control->ui(), STD_PLACEHOLDERS::_2));
+
+ // Temporary names, need to change this to accept real rates rather
+ // than kB.
+- CMD2_ANY_LIST ("throttle.up",
tr1::bind(&apply_throttle, tr1::placeholders::_2, true));
+- CMD2_ANY_LIST ("throttle.down",
tr1::bind(&apply_throttle, tr1::placeholders::_2, false));
+- CMD2_ANY_LIST ("throttle.ip",
tr1::bind(&apply_address_throttle, tr1::placeholders::_2));
+-
+- CMD2_ANY_STRING ("throttle.up.max", tr1::bind(&retrieve_throttle_info,
tr1::placeholders::_2, throttle_info_up | throttle_info_max));
+- CMD2_ANY_STRING ("throttle.up.rate", tr1::bind(&retrieve_throttle_info,
tr1::placeholders::_2, throttle_info_up | throttle_info_rate));
+- CMD2_ANY_STRING ("throttle.down.max", tr1::bind(&retrieve_throttle_info,
tr1::placeholders::_2, throttle_info_down | throttle_info_max));
+- CMD2_ANY_STRING ("throttle.down.rate", tr1::bind(&retrieve_throttle_info,
tr1::placeholders::_2, throttle_info_down | throttle_info_rate));
++ CMD2_ANY_LIST ("throttle.up",
bind(&apply_throttle, STD_PLACEHOLDERS::_2, true));
++ CMD2_ANY_LIST ("throttle.down",
bind(&apply_throttle, STD_PLACEHOLDERS::_2, false));
++ CMD2_ANY_LIST ("throttle.ip",
bind(&apply_address_throttle, STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY_STRING ("throttle.up.max", bind(&retrieve_throttle_info,
STD_PLACEHOLDERS::_2, throttle_info_up | throttle_info_max));
++ CMD2_ANY_STRING ("throttle.up.rate", bind(&retrieve_throttle_info,
STD_PLACEHOLDERS::_2, throttle_info_up | throttle_info_rate));
++ CMD2_ANY_STRING ("throttle.down.max", bind(&retrieve_throttle_info,
STD_PLACEHOLDERS::_2, throttle_info_down | throttle_info_max));
++ CMD2_ANY_STRING ("throttle.down.rate", bind(&retrieve_throttle_info,
STD_PLACEHOLDERS::_2, throttle_info_down | throttle_info_rate));
+ }
ADDED net/rtorrent/patches/patch-src_command__tracker.cc
Index: net/rtorrent/patches/patch-src_command__tracker.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__tracker.cc
+++ net/rtorrent/patches/patch-src_command__tracker.cc
@@ -0,0 +1,123 @@
+$NetBSD$
+
+--- src/command_tracker.cc.orig 2012-04-09 06:39:14.000000000 +0000
++++ src/command_tracker.cc
+@@ -51,6 +51,16 @@
+ #include "command_helpers.h"
+ #include "core/dht_manager.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ void
+ tracker_set_enabled(torrent::Tracker* tracker, bool state) {
+ if (state)
+@@ -111,59 +121,59 @@ apply_enable_trackers(int64_t arg) {
+
+ void
+ initialize_command_tracker() {
+- CMD2_TRACKER ("t.is_open",
tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.is_enabled",
tr1::bind(&torrent::Tracker::is_enabled, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.is_usable",
tr1::bind(&torrent::Tracker::is_usable, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.is_busy",
tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.is_extra_tracker",
tr1::bind(&torrent::Tracker::is_extra_tracker, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.can_scrape",
tr1::bind(&torrent::Tracker::can_scrape, tr1::placeholders::_1));
+-
+- CMD2_TRACKER_V ("t.enable",
tr1::bind(&torrent::Tracker::enable, tr1::placeholders::_1));
+- CMD2_TRACKER_V ("t.disable",
tr1::bind(&torrent::Tracker::disable, tr1::placeholders::_1));
+-
+- CMD2_TRACKER_VALUE_V("t.is_enabled.set", tr1::bind(&tracker_set_enabled,
tr1::placeholders::_1, tr1::placeholders::_2));
+-
+- CMD2_TRACKER ("t.url",
tr1::bind(&torrent::Tracker::url, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.group",
tr1::bind(&torrent::Tracker::group, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.type",
tr1::bind(&torrent::Tracker::type, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.id",
tr1::bind(&torrent::Tracker::tracker_id, tr1::placeholders::_1));
+-
+- CMD2_TRACKER ("t.latest_event",
tr1::bind(&torrent::Tracker::latest_event, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.latest_new_peers",
tr1::bind(&torrent::Tracker::latest_new_peers, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.latest_sum_peers",
tr1::bind(&torrent::Tracker::latest_sum_peers, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.is_open",
bind(&torrent::Tracker::is_busy, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.is_enabled",
bind(&torrent::Tracker::is_enabled, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.is_usable",
bind(&torrent::Tracker::is_usable, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.is_busy",
bind(&torrent::Tracker::is_busy, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.is_extra_tracker",
bind(&torrent::Tracker::is_extra_tracker, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.can_scrape",
bind(&torrent::Tracker::can_scrape, STD_PLACEHOLDERS::_1));
++
++ CMD2_TRACKER_V ("t.enable", bind(&torrent::Tracker::enable,
STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER_V ("t.disable",
bind(&torrent::Tracker::disable, STD_PLACEHOLDERS::_1));
++
++ CMD2_TRACKER_VALUE_V("t.is_enabled.set", bind(&tracker_set_enabled,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++
++ CMD2_TRACKER ("t.url", bind(&torrent::Tracker::url,
STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.group", bind(&torrent::Tracker::group,
STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.type", bind(&torrent::Tracker::type,
STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.id",
bind(&torrent::Tracker::tracker_id, STD_PLACEHOLDERS::_1));
++
++ CMD2_TRACKER ("t.latest_event",
bind(&torrent::Tracker::latest_event, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.latest_new_peers",
bind(&torrent::Tracker::latest_new_peers, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.latest_sum_peers",
bind(&torrent::Tracker::latest_sum_peers, STD_PLACEHOLDERS::_1));
+
+ // Time since last connection, connection attempt.
+
+- CMD2_TRACKER ("t.normal_interval",
tr1::bind(&torrent::Tracker::normal_interval, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.min_interval",
tr1::bind(&torrent::Tracker::min_interval, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.normal_interval",
bind(&torrent::Tracker::normal_interval, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.min_interval",
bind(&torrent::Tracker::min_interval, STD_PLACEHOLDERS::_1));
+
+- CMD2_TRACKER ("t.activity_time_next",
tr1::bind(&torrent::Tracker::activity_time_next, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.activity_time_last",
tr1::bind(&torrent::Tracker::activity_time_last, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.activity_time_next",
bind(&torrent::Tracker::activity_time_next, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.activity_time_last",
bind(&torrent::Tracker::activity_time_last, STD_PLACEHOLDERS::_1));
+
+- CMD2_TRACKER ("t.success_time_next",
tr1::bind(&torrent::Tracker::success_time_next, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.success_time_last",
tr1::bind(&torrent::Tracker::success_time_last, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.success_counter",
tr1::bind(&torrent::Tracker::success_counter, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.success_time_next",
bind(&torrent::Tracker::success_time_next, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.success_time_last",
bind(&torrent::Tracker::success_time_last, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.success_counter",
bind(&torrent::Tracker::success_counter, STD_PLACEHOLDERS::_1));
+
+- CMD2_TRACKER ("t.failed_time_next",
tr1::bind(&torrent::Tracker::failed_time_next, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.failed_time_last",
tr1::bind(&torrent::Tracker::failed_time_last, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.failed_counter",
tr1::bind(&torrent::Tracker::failed_counter, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.failed_time_next",
bind(&torrent::Tracker::failed_time_next, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.failed_time_last",
bind(&torrent::Tracker::failed_time_last, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.failed_counter",
bind(&torrent::Tracker::failed_counter, STD_PLACEHOLDERS::_1));
+
+- CMD2_TRACKER ("t.scrape_time_last",
tr1::bind(&torrent::Tracker::scrape_time_last, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.scrape_counter",
tr1::bind(&torrent::Tracker::scrape_counter, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.scrape_time_last",
bind(&torrent::Tracker::scrape_time_last, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.scrape_counter",
bind(&torrent::Tracker::scrape_counter, STD_PLACEHOLDERS::_1));
+
+- CMD2_TRACKER ("t.scrape_complete",
tr1::bind(&torrent::Tracker::scrape_complete, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.scrape_incomplete",
tr1::bind(&torrent::Tracker::scrape_incomplete, tr1::placeholders::_1));
+- CMD2_TRACKER ("t.scrape_downloaded",
tr1::bind(&torrent::Tracker::scrape_downloaded, tr1::placeholders::_1));
++ CMD2_TRACKER ("t.scrape_complete",
bind(&torrent::Tracker::scrape_complete, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.scrape_incomplete",
bind(&torrent::Tracker::scrape_incomplete, STD_PLACEHOLDERS::_1));
++ CMD2_TRACKER ("t.scrape_downloaded",
bind(&torrent::Tracker::scrape_downloaded, STD_PLACEHOLDERS::_1));
+
+- CMD2_ANY_VALUE ("trackers.enable",
tr1::bind(&apply_enable_trackers, int64_t(1)));
+- CMD2_ANY_VALUE ("trackers.disable",
tr1::bind(&apply_enable_trackers, int64_t(0)));
++ CMD2_ANY_VALUE ("trackers.enable", bind(&apply_enable_trackers,
int64_t(1)));
++ CMD2_ANY_VALUE ("trackers.disable", bind(&apply_enable_trackers,
int64_t(0)));
+ CMD2_VAR_VALUE ("trackers.numwant", -1);
+ CMD2_VAR_BOOL ("trackers.use_udp", true);
+
+- CMD2_ANY_STRING_V ("dht.mode.set",
tr1::bind(&core::DhtManager::set_mode, control->dht_manager(),
tr1::placeholders::_2));
++ CMD2_ANY_STRING_V ("dht.mode.set",
bind(&core::DhtManager::set_mode, control->dht_manager(),
STD_PLACEHOLDERS::_2));
+ CMD2_VAR_VALUE ("dht.port", int64_t(6881));
+- CMD2_ANY_STRING ("dht.add_node",
tr1::bind(&apply_dht_add_node, tr1::placeholders::_2));
+- CMD2_ANY ("dht.statistics",
tr1::bind(&core::DhtManager::dht_statistics, control->dht_manager()));
+- CMD2_ANY ("dht.throttle.name",
tr1::bind(&core::DhtManager::throttle_name, control->dht_manager()));
+- CMD2_ANY_STRING_V ("dht.throttle.name.set",
tr1::bind(&core::DhtManager::set_throttle_name, control->dht_manager(),
tr1::placeholders::_2));
++ CMD2_ANY_STRING ("dht.add_node", bind(&apply_dht_add_node,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY ("dht.statistics",
bind(&core::DhtManager::dht_statistics, control->dht_manager()));
++ CMD2_ANY ("dht.throttle.name",
bind(&core::DhtManager::throttle_name, control->dht_manager()));
++ CMD2_ANY_STRING_V ("dht.throttle.name.set",
bind(&core::DhtManager::set_throttle_name, control->dht_manager(),
STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_command__ui.cc
Index: net/rtorrent/patches/patch-src_command__ui.cc
==================================================================
--- net/rtorrent/patches/patch-src_command__ui.cc
+++ net/rtorrent/patches/patch-src_command__ui.cc
@@ -0,0 +1,120 @@
+$NetBSD$
+
+--- src/command_ui.cc.orig 2012-03-20 16:25:05.000000000 +0000
++++ src/command_ui.cc
+@@ -53,6 +53,16 @@
+ #include "control.h"
+ #include "command_helpers.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ typedef void (core::ViewManager::*view_cfilter_slot)(const std::string&,
const torrent::Object&);
+ typedef void (core::ViewManager::*view_event_slot)(const std::string&, const
std::string&);
+
+@@ -541,41 +551,41 @@ void
+ initialize_command_ui() {
+ CMD2_VAR_STRING("keys.layout", "qwerty");
+
+- CMD2_ANY_STRING("view.add",
object_convert_void(tr1::bind(&core::ViewManager::insert_throw,
control->view_manager(), tr1::placeholders::_2)));
++ CMD2_ANY_STRING("view.add",
object_convert_void(bind(&core::ViewManager::insert_throw,
control->view_manager(), STD_PLACEHOLDERS::_2)));
+
+- CMD2_ANY_L ("view.list", tr1::bind(&apply_view_list));
+- CMD2_ANY_LIST("view.set", tr1::bind(&apply_view_set,
tr1::placeholders::_2));
++ CMD2_ANY_L ("view.list", bind(&apply_view_list));
++ CMD2_ANY_LIST("view.set", bind(&apply_view_set,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST("view.filter", tr1::bind(&apply_view_cfilter,
&core::ViewManager::set_filter, tr1::placeholders::_2));
+- CMD2_ANY_LIST("view.filter_on", tr1::bind(&apply_view_filter_on,
tr1::placeholders::_2));
++ CMD2_ANY_LIST("view.filter", bind(&apply_view_cfilter,
&core::ViewManager::set_filter, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST("view.filter_on", bind(&apply_view_filter_on,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST("view.sort", tr1::bind(&apply_view_sort,
tr1::placeholders::_2));
+- CMD2_ANY_LIST("view.sort_new", tr1::bind(&apply_view_cfilter,
&core::ViewManager::set_sort_new, tr1::placeholders::_2));
+- CMD2_ANY_LIST("view.sort_current", tr1::bind(&apply_view_cfilter,
&core::ViewManager::set_sort_current, tr1::placeholders::_2));
++ CMD2_ANY_LIST("view.sort", bind(&apply_view_sort,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST("view.sort_new", bind(&apply_view_cfilter,
&core::ViewManager::set_sort_new, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST("view.sort_current", bind(&apply_view_cfilter,
&core::ViewManager::set_sort_current, STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST("view.event_added", tr1::bind(&apply_view_event,
&core::ViewManager::set_event_added, tr1::placeholders::_2));
+- CMD2_ANY_LIST("view.event_removed", tr1::bind(&apply_view_event,
&core::ViewManager::set_event_removed, tr1::placeholders::_2));
++ CMD2_ANY_LIST("view.event_added", bind(&apply_view_event,
&core::ViewManager::set_event_added, STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST("view.event_removed", bind(&apply_view_event,
&core::ViewManager::set_event_removed, STD_PLACEHOLDERS::_2));
+
+ // Cleanup and add . to view.
+
+- CMD2_ANY_STRING("view.size", tr1::bind(&cmd_view_size,
tr1::placeholders::_2));
+- CMD2_ANY_STRING("view.size_not_visible",
tr1::bind(&cmd_view_size_not_visible, tr1::placeholders::_2));
+- CMD2_ANY_STRING("view.persistent", tr1::bind(&cmd_view_persistent,
tr1::placeholders::_2));
+-
+- CMD2_ANY_STRING_V("view.filter_all", tr1::bind(&core::View::filter,
tr1::bind(&core::ViewManager::find_ptr_throw, control->view_manager(),
tr1::placeholders::_2)));
+-
+- CMD2_DL_STRING ("view.filter_download",
tr1::bind(&cmd_view_filter_download, tr1::placeholders::_1,
tr1::placeholders::_2));
+- CMD2_DL_STRING ("view.set_visible", tr1::bind(&cmd_view_set_visible,
tr1::placeholders::_1, tr1::placeholders::_2));
+- CMD2_DL_STRING ("view.set_not_visible",
tr1::bind(&cmd_view_set_not_visible, tr1::placeholders::_1,
tr1::placeholders::_2));
++ CMD2_ANY_STRING("view.size", bind(&cmd_view_size,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING("view.size_not_visible", bind(&cmd_view_size_not_visible,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_STRING("view.persistent", bind(&cmd_view_persistent,
STD_PLACEHOLDERS::_2));
++
++ CMD2_ANY_STRING_V("view.filter_all", bind(&core::View::filter,
bind(&core::ViewManager::find_ptr_throw, control->view_manager(),
STD_PLACEHOLDERS::_2)));
++
++ CMD2_DL_STRING ("view.filter_download", bind(&cmd_view_filter_download,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_STRING ("view.set_visible", bind(&cmd_view_set_visible,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
++ CMD2_DL_STRING ("view.set_not_visible", bind(&cmd_view_set_not_visible,
STD_PLACEHOLDERS::_1, STD_PLACEHOLDERS::_2));
+
+ // Commands that affect the default rtorrent UI.
+- CMD2_DL ("ui.unfocus_download",
tr1::bind(&cmd_ui_unfocus_download, tr1::placeholders::_1));
+- CMD2_ANY_STRING("ui.current_view.set", tr1::bind(&cmd_ui_set_view,
tr1::placeholders::_2));
++ CMD2_DL ("ui.unfocus_download", bind(&cmd_ui_unfocus_download,
STD_PLACEHOLDERS::_1));
++ CMD2_ANY_STRING("ui.current_view.set", bind(&cmd_ui_set_view,
STD_PLACEHOLDERS::_2));
+
+ // Move.
+ CMD2_ANY("print", &apply_print);
+ CMD2_ANY("cat", &apply_cat);
+- CMD2_ANY("if", tr1::bind(&apply_if, tr1::placeholders::_1,
tr1::placeholders::_2, 0));
++ CMD2_ANY("if", bind(&apply_if, STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, 0));
+ CMD2_ANY("not", &apply_not);
+ CMD2_ANY("false", &apply_false);
+ CMD2_ANY("and", &apply_and);
+@@ -583,22 +593,22 @@ initialize_command_ui() {
+
+ // A temporary command for handling stuff until we get proper
+ // support for seperation of commands and literals.
+- CMD2_ANY("branch", tr1::bind(&apply_if, tr1::placeholders::_1,
tr1::placeholders::_2, 1));
++ CMD2_ANY("branch", bind(&apply_if, STD_PLACEHOLDERS::_1,
STD_PLACEHOLDERS::_2, 1));
+
+ CMD2_ANY_LIST("less", &apply_less);
+ CMD2_ANY_LIST("greater", &apply_greater);
+ CMD2_ANY_LIST("equal", &apply_equal);
+
+- CMD2_ANY_VALUE("convert.gm_time", tr1::bind(&apply_to_time,
tr1::placeholders::_2, 0));
+- CMD2_ANY_VALUE("convert.gm_date", tr1::bind(&apply_to_time,
tr1::placeholders::_2, 0x2));
+- CMD2_ANY_VALUE("convert.time", tr1::bind(&apply_to_time,
tr1::placeholders::_2, 0x1));
+- CMD2_ANY_VALUE("convert.date", tr1::bind(&apply_to_time,
tr1::placeholders::_2, 0x1 | 0x2));
+- CMD2_ANY_VALUE("convert.elapsed_time", tr1::bind(&apply_to_elapsed_time,
tr1::placeholders::_2));
+- CMD2_ANY_VALUE("convert.kb", tr1::bind(&apply_to_kb,
tr1::placeholders::_2));
+- CMD2_ANY_VALUE("convert.mb", tr1::bind(&apply_to_mb,
tr1::placeholders::_2));
+- CMD2_ANY_VALUE("convert.xb", tr1::bind(&apply_to_xb,
tr1::placeholders::_2));
+- CMD2_ANY_VALUE("convert.throttle", tr1::bind(&apply_to_throttle,
tr1::placeholders::_2));
++ CMD2_ANY_VALUE("convert.gm_time", bind(&apply_to_time,
STD_PLACEHOLDERS::_2, 0));
++ CMD2_ANY_VALUE("convert.gm_date", bind(&apply_to_time,
STD_PLACEHOLDERS::_2, 0x2));
++ CMD2_ANY_VALUE("convert.time", bind(&apply_to_time,
STD_PLACEHOLDERS::_2, 0x1));
++ CMD2_ANY_VALUE("convert.date", bind(&apply_to_time,
STD_PLACEHOLDERS::_2, 0x1 | 0x2));
++ CMD2_ANY_VALUE("convert.elapsed_time", bind(&apply_to_elapsed_time,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE("convert.kb", bind(&apply_to_kb,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE("convert.mb", bind(&apply_to_mb,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE("convert.xb", bind(&apply_to_xb,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_VALUE("convert.throttle", bind(&apply_to_throttle,
STD_PLACEHOLDERS::_2));
+
+- CMD2_ANY_LIST ("elapsed.less", tr1::bind(&apply_elapsed_less,
tr1::placeholders::_2));
+- CMD2_ANY_LIST ("elapsed.greater", tr1::bind(&apply_elapsed_greater,
tr1::placeholders::_2));
++ CMD2_ANY_LIST ("elapsed.less", bind(&apply_elapsed_less,
STD_PLACEHOLDERS::_2));
++ CMD2_ANY_LIST ("elapsed.greater", bind(&apply_elapsed_greater,
STD_PLACEHOLDERS::_2));
+ }
ADDED net/rtorrent/patches/patch-src_control.cc
Index: net/rtorrent/patches/patch-src_control.cc
==================================================================
--- net/rtorrent/patches/patch-src_control.cc
+++ net/rtorrent/patches/patch-src_control.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/control.cc.orig 2012-04-18 07:55:20.000000000 +0000
++++ src/control.cc
+@@ -58,6 +58,14 @@
+
+ #include "control.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ Control::Control() :
+ m_ui(new ui::Root()),
+ m_display(new display::Manager()),
+@@ -77,7 +85,7 @@ Control::Control() :
+
+ m_inputStdin->slot_pressed(sigc::mem_fun(m_input,
&input::Manager::pressed));
+
+- m_taskShutdown.slot() = std::tr1::bind(&Control::handle_shutdown, this);
++ m_taskShutdown.slot() = bind(&Control::handle_shutdown, this);
+
+ m_commandScheduler->set_slot_error_message(rak::mem_fn(m_core,
&core::Manager::push_log_std));
+ }
ADDED net/rtorrent/patches/patch-src_core_curl__get.cc
Index: net/rtorrent/patches/patch-src_core_curl__get.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_curl__get.cc
+++ net/rtorrent/patches/patch-src_core_curl__get.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/core/curl_get.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/core/curl_get.cc
+@@ -45,6 +45,14 @@
+ #include "curl_get.h"
+ #include "curl_stack.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace core {
+
+ size_t
+@@ -82,7 +90,7 @@ CurlGet::start() {
+
+ // Normally libcurl should handle the timeout. But sometimes that doesn't
+ // work right so we do a fallback timeout that just aborts the transfer.
+- m_taskTimeout.slot() = std::tr1::bind(&CurlGet::receive_timeout, this);
++ m_taskTimeout.slot() = bind(&CurlGet::receive_timeout, this);
+ priority_queue_erase(&taskScheduler, &m_taskTimeout);
+ priority_queue_insert(&taskScheduler, &m_taskTimeout, cachedTime +
rak::timer::from_seconds(m_timeout + 5));
+ }
ADDED net/rtorrent/patches/patch-src_core_curl__stack.cc
Index: net/rtorrent/patches/patch-src_core_curl__stack.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_curl__stack.cc
+++ net/rtorrent/patches/patch-src_core_curl__stack.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/core/curl_stack.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/core/curl_stack.cc
+@@ -46,6 +46,14 @@
+ #include "curl_socket.h"
+ #include "curl_stack.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace core {
+
+ CurlStack::CurlStack() :
+@@ -55,7 +63,7 @@ CurlStack::CurlStack() :
+ m_ssl_verify_peer(true),
+ m_dns_timeout(60) {
+
+- m_taskTimeout.slot() = std::tr1::bind(&CurlStack::receive_timeout, this);
++ m_taskTimeout.slot() = bind(&CurlStack::receive_timeout, this);
+
+ #if (LIBCURL_VERSION_NUM >= 0x071000)
+ curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERDATA, this);
ADDED net/rtorrent/patches/patch-src_core_dht__manager.cc
Index: net/rtorrent/patches/patch-src_core_dht__manager.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_dht__manager.cc
+++ net/rtorrent/patches/patch-src_core_dht__manager.cc
@@ -0,0 +1,37 @@
+$NetBSD$
+
+--- src/core/dht_manager.cc.orig 2012-03-13 12:10:49.000000000 +0000
++++ src/core/dht_manager.cc
+@@ -54,6 +54,14 @@
+ #include "download_store.h"
+ #include "manager.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace core {
+
+ const char* DhtManager::dht_settings[dht_settings_num] = { "disable", "off",
"auto", "on" };
+@@ -114,7 +122,7 @@ DhtManager::start_dht() {
+ torrent::dht_manager()->start(port);
+ torrent::dht_manager()->reset_statistics();
+
+- m_updateTimeout.slot() = std::tr1::bind(&DhtManager::update, this);
++ m_updateTimeout.slot() = bind(&DhtManager::update, this);
+ priority_queue_insert(&taskScheduler, &m_updateTimeout, (cachedTime +
rak::timer::from_seconds(60)).round_seconds());
+
+ m_dhtPrevCycle = 0;
+@@ -197,7 +205,7 @@ DhtManager::update() {
+ break;
+
+ if (itr == end) {
+- m_stopTimeout.slot() = std::tr1::bind(&DhtManager::stop_dht, this);
++ m_stopTimeout.slot() = bind(&DhtManager::stop_dht, this);
+ priority_queue_insert(&taskScheduler, &m_stopTimeout, (cachedTime +
rak::timer::from_seconds(15 * 60)).round_seconds());
+ }
+ }
ADDED net/rtorrent/patches/patch-src_core_download.cc
Index: net/rtorrent/patches/patch-src_core_download.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_download.cc
+++ net/rtorrent/patches/patch-src_core_download.cc
@@ -0,0 +1,36 @@
+$NetBSD$
+
+--- src/core/download.cc.orig 2012-04-12 06:30:12.000000000 +0000
++++ src/core/download.cc
+@@ -53,6 +53,16 @@
+ #include "download.h"
+ #include "manager.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ namespace core {
+
+ Download::Download(download_type d) :
+@@ -63,10 +73,10 @@ Download::Download(download_type d) :
+ m_resumeFlags(~uint32_t()),
+ m_group(0) {
+
+-
m_download.info()->signal_tracker_success().push_back(tr1::bind(&Download::receive_tracker_msg,
this, ""));
+-
m_download.info()->signal_tracker_failed().push_back(tr1::bind(&Download::receive_tracker_msg,
this, tr1::placeholders::_1));
+-
m_download.info()->signal_storage_error().push_back(tr1::bind(&Download::receive_storage_error,
this, tr1::placeholders::_1));
+-
m_download.info()->signal_chunk_failed().push_back(tr1::bind(&Download::receive_chunk_failed,
this, tr1::placeholders::_1));
++
m_download.info()->signal_tracker_success().push_back(bind(&Download::receive_tracker_msg,
this, ""));
++
m_download.info()->signal_tracker_failed().push_back(bind(&Download::receive_tracker_msg,
this, STD_PLACEHOLDERS::_1));
++
m_download.info()->signal_storage_error().push_back(bind(&Download::receive_storage_error,
this, STD_PLACEHOLDERS::_1));
++
m_download.info()->signal_chunk_failed().push_back(bind(&Download::receive_chunk_failed,
this, STD_PLACEHOLDERS::_1));
+ }
+
+ Download::~Download() {
ADDED net/rtorrent/patches/patch-src_core_download__factory.cc
Index: net/rtorrent/patches/patch-src_core_download__factory.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_download__factory.cc
+++ net/rtorrent/patches/patch-src_core_download__factory.cc
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- src/core/download_factory.cc.orig 2012-04-15 16:28:16.000000000 +0000
++++ src/core/download_factory.cc
+@@ -41,7 +41,15 @@
+ #include <sstream>
+ #include <stdexcept>
+ #include <rak/path.h>
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
+ #include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
+ #include <torrent/utils/log.h>
+ #include <torrent/utils/resume.h>
+ #include <torrent/object.h>
+@@ -107,8 +115,8 @@ DownloadFactory::DownloadFactory(Manager
+ m_printLog(true),
+ m_isFile(false) {
+
+- m_taskLoad.slot() = std::tr1::bind(&DownloadFactory::receive_load, this);
+- m_taskCommit.slot() = std::tr1::bind(&DownloadFactory::receive_commit,
this);
++ m_taskLoad.slot() = bind(&DownloadFactory::receive_load, this);
++ m_taskCommit.slot() = bind(&DownloadFactory::receive_commit, this);
+
+ // m_variables["connection_leech"] =
rpc::call_command_void("protocol.connection.leech");
+ // m_variables["connection_seed"] =
rpc::call_command_void("protocol.connection.seed");
+@@ -158,8 +166,8 @@ DownloadFactory::receive_load() {
+ m_stream = new std::stringstream;
+ HttpQueue::iterator itr = m_manager->http_queue()->insert(m_uri,
m_stream);
+
+-
(*itr)->signal_done().push_front(std::tr1::bind(&DownloadFactory::receive_loaded,
this));
+-
(*itr)->signal_failed().push_front(std::tr1::bind(&DownloadFactory::receive_failed,
this, std::tr1::placeholders::_1));
++ (*itr)->signal_done().push_front(bind(&DownloadFactory::receive_loaded,
this));
++ (*itr)->signal_failed().push_front(bind(&DownloadFactory::receive_failed,
this, STD_PLACEHOLDERS::_1));
+
+ m_variables["tied_to_file"] = (int64_t)false;
+
ADDED net/rtorrent/patches/patch-src_core_download__list.cc
Index: net/rtorrent/patches/patch-src_core_download__list.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_download__list.cc
+++ net/rtorrent/patches/patch-src_core_download__list.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/core/download_list.cc.orig 2012-02-22 07:50:48.000000000 +0000
++++ src/core/download_list.cc
+@@ -65,6 +65,14 @@
+ #include "download_list.h"
+ #include "download_store.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ #define DL_TRIGGER_EVENT(download, event_name) \
+ rpc::commands.call_catch(event_name, rpc::make_target(download),
torrent::Object(), "Event '" event_name "' failed: ");
+
+@@ -181,8 +189,8 @@ DownloadList::insert(Download* download)
+ lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(),
"download_list", "Inserting download.");
+
+ try {
+- (*itr)->data()->slot_initial_hash() =
tr1::bind(&DownloadList::hash_done, this, download);
+- (*itr)->data()->slot_download_done() =
tr1::bind(&DownloadList::received_finished, this, download);
++ (*itr)->data()->slot_initial_hash() =
bind(&DownloadList::hash_done, this, download);
++ (*itr)->data()->slot_download_done() =
bind(&DownloadList::received_finished, this, download);
+
+ // This needs to be separated into two different calls to ensure
+ // the download remains in the view.
ADDED net/rtorrent/patches/patch-src_core_http__queue.cc
Index: net/rtorrent/patches/patch-src_core_http__queue.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_http__queue.cc
+++ net/rtorrent/patches/patch-src_core_http__queue.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/core/http_queue.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/core/http_queue.cc
+@@ -46,6 +46,14 @@
+ #include "http_queue.h"
+ #include "curl_get.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace core {
+
+ HttpQueue::iterator
+@@ -58,8 +66,8 @@ HttpQueue::insert(const std::string& url
+
+ iterator itr = Base::insert(end(), h.get());
+
+- h->signal_done().push_back(std::tr1::bind(&HttpQueue::erase, this, itr));
+- h->signal_failed().push_back(std::tr1::bind(&HttpQueue::erase, this, itr));
++ h->signal_done().push_back(bind(&HttpQueue::erase, this, itr));
++ h->signal_failed().push_back(bind(&HttpQueue::erase, this, itr));
+
+ (*itr)->start();
+
ADDED net/rtorrent/patches/patch-src_core_manager.cc
Index: net/rtorrent/patches/patch-src_core_manager.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_manager.cc
+++ net/rtorrent/patches/patch-src_core_manager.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/core/manager.cc.orig 2012-04-16 06:19:49.000000000 +0000
++++ src/core/manager.cc
+@@ -74,6 +74,14 @@
+ #include "poll_manager.h"
+ #include "view.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace core {
+
+ void
+@@ -205,7 +213,7 @@ Manager::get_address_throttle(const sock
+ // Most of this should be possible to move out.
+ void
+ Manager::initialize_second() {
+- torrent::Http::slot_factory() = std::tr1::bind(&CurlStack::new_object,
m_httpStack);
++ torrent::Http::slot_factory() = bind(&CurlStack::new_object, m_httpStack);
+ m_httpQueue->slot_factory(sigc::mem_fun(m_httpStack,
&CurlStack::new_object));
+
+ CurlStack::global_init();
ADDED net/rtorrent/patches/patch-src_core_manager.h
Index: net/rtorrent/patches/patch-src_core_manager.h
==================================================================
--- net/rtorrent/patches/patch-src_core_manager.h
+++ net/rtorrent/patches/patch-src_core_manager.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/core/manager.h.orig 2012-03-13 12:10:49.000000000 +0000
++++ src/core/manager.h
+@@ -118,10 +118,12 @@ public:
+
+ void handshake_log(const sockaddr* sa, int msg, int err,
const torrent::HashString* hash);
+
+- static const int create_start = 0x1;
+- static const int create_tied = 0x2;
+- static const int create_quiet = 0x4;
+- static const int create_raw_data = 0x8;
++ enum {
++ create_start = 0x1,
++ create_tied = 0x2,
++ create_quiet = 0x4,
++ create_raw_data = 0x8
++ };
+
+ typedef std::vector<std::string> command_list_type;
+
ADDED net/rtorrent/patches/patch-src_core_view.cc
Index: net/rtorrent/patches/patch-src_core_view.cc
==================================================================
--- net/rtorrent/patches/patch-src_core_view.cc
+++ net/rtorrent/patches/patch-src_core_view.cc
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/core/view.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/core/view.cc
+@@ -172,7 +172,7 @@ View::initialize(const std::string& name
+ m_focus = 0;
+
+ set_last_changed(rak::timer());
+- m_delayChanged.slot() = std::tr1::bind(&signal_type::operator(),
&m_signalChanged);
++ m_delayChanged.slot() = bind(&signal_type::operator(), &m_signalChanged);
+ }
+
+ void
ADDED net/rtorrent/patches/patch-src_display_frame.cc
Index: net/rtorrent/patches/patch-src_display_frame.cc
==================================================================
--- net/rtorrent/patches/patch-src_display_frame.cc
+++ net/rtorrent/patches/patch-src_display_frame.cc
@@ -0,0 +1,47 @@
+$NetBSD$
+
+--- src/display/frame.cc.orig 2012-01-19 10:18:01.000000000 +0000
++++ src/display/frame.cc
+@@ -38,7 +38,16 @@
+
+ #include <algorithm>
+ #include <functional>
++#if __cplusplus >= 201103L
++using std::function;
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
+ #include <tr1/functional>
++using std::tr1::function;
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
+ #include <rak/algorithm.h>
+ #include <torrent/exceptions.h>
+
+@@ -367,9 +376,9 @@ Frame::balance_row(uint32_t x, uint32_t
+ //
+ // Else if we're short, only give each what they require.
+ std::stable_sort(dynamicFrames, dynamicFrames + dynamicSize,
+- std::tr1::bind(std::greater<extent_type>(),
+- std::tr1::bind(&dynamic_min_height,
std::tr1::placeholders::_1),
+- std::tr1::bind(&dynamic_min_height,
std::tr1::placeholders::_2)));
++ bind(std::greater<extent_type>(),
++ bind(&dynamic_min_height,
STD_PLACEHOLDERS::_1),
++ bind(&dynamic_min_height,
STD_PLACEHOLDERS::_2)));
+
+ bool retry;
+
+@@ -442,9 +451,9 @@ Frame::balance_column(uint32_t x, uint32
+ //
+ // Else if we're short, only give each what they require.
+ std::stable_sort(dynamicFrames, dynamicFrames + dynamicSize,
+- std::tr1::bind(std::greater<extent_type>(),
+- std::tr1::bind(&dynamic_min_width,
std::tr1::placeholders::_1),
+- std::tr1::bind(&dynamic_min_width,
std::tr1::placeholders::_2)));
++ bind(std::greater<extent_type>(),
++ bind(&dynamic_min_width,
STD_PLACEHOLDERS::_1),
++ bind(&dynamic_min_width,
STD_PLACEHOLDERS::_2)));
+
+ bool retry;
+
ADDED net/rtorrent/patches/patch-src_display_manager.cc
Index: net/rtorrent/patches/patch-src_display_manager.cc
==================================================================
--- net/rtorrent/patches/patch-src_display_manager.cc
+++ net/rtorrent/patches/patch-src_display_manager.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- src/display/manager.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/display/manager.cc
+@@ -45,12 +45,20 @@
+ #include "manager.h"
+ #include "window.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace display {
+
+ Manager::Manager() :
+ m_forceRedraw(false) {
+
+- m_taskUpdate.slot() = std::tr1::bind(&Manager::receive_update, this);
++ m_taskUpdate.slot() = bind(&Manager::receive_update, this);
+ }
+
+ Manager::~Manager() {
ADDED net/rtorrent/patches/patch-src_display_window.cc
Index: net/rtorrent/patches/patch-src_display_window.cc
==================================================================
--- net/rtorrent/patches/patch-src_display_window.cc
+++ net/rtorrent/patches/patch-src_display_window.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/display/window.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/display/window.cc
+@@ -40,6 +40,14 @@
+
+ #include "window.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace display {
+
+ Window::SlotTimer Window::m_slotSchedule;
+@@ -59,7 +67,7 @@ Window::Window(Canvas* canvas, int flags
+ m_maxWidth(maxWidth),
+ m_maxHeight(maxHeight) {
+
+- m_taskUpdate.slot() = std::tr1::bind(&Window::redraw, this);
++ m_taskUpdate.slot() = bind(&Window::redraw, this);
+ }
+
+ Window::~Window() {
ADDED net/rtorrent/patches/patch-src_display_window__file__list.cc
Index: net/rtorrent/patches/patch-src_display_window__file__list.cc
==================================================================
--- net/rtorrent/patches/patch-src_display_window__file__list.cc
+++ net/rtorrent/patches/patch-src_display_window__file__list.cc
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/display/window_file_list.cc.orig 2012-02-14 03:32:01.000000000
+0000
++++ src/display/window_file_list.cc
+@@ -36,6 +36,7 @@
+
+ #include "config.h"
+
++#include <locale>
+ #include <stdio.h>
+ #include <torrent/path.h>
+ #include <torrent/data/file.h>
ADDED net/rtorrent/patches/patch-src_display_window__log.cc
Index: net/rtorrent/patches/patch-src_display_window__log.cc
==================================================================
--- net/rtorrent/patches/patch-src_display_window__log.cc
+++ net/rtorrent/patches/patch-src_display_window__log.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- src/display/window_log.cc.orig 2012-03-13 12:10:49.000000000 +0000
++++ src/display/window_log.cc
+@@ -44,17 +44,25 @@
+ #include "utils.h"
+ #include "window_log.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace display {
+
+ WindowLog::WindowLog(torrent::log_buffer* l) :
+ Window(new Canvas, 0, 0, 0, extent_full, extent_static),
+ m_log(l) {
+
+- m_taskUpdate.slot() = std::tr1::bind(&WindowLog::receive_update, this);
++ m_taskUpdate.slot() = bind(&WindowLog::receive_update, this);
+
+- unsigned int signal_index =
torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&WindowLog::receive_update,
this));
++ unsigned int signal_index =
torrent::main_thread()->signal_bitfield()->add_signal(bind(&WindowLog::receive_update,
this));
+
+-
m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal,
torrent::main_thread(), signal_index, false));
++
m_log->lock_and_set_update_slot(bind(&torrent::thread_base::send_event_signal,
torrent::main_thread(), signal_index, false));
+ }
+
+ WindowLog::~WindowLog() {
ADDED net/rtorrent/patches/patch-src_rpc_command.h
Index: net/rtorrent/patches/patch-src_rpc_command.h
==================================================================
--- net/rtorrent/patches/patch-src_rpc_command.h
+++ net/rtorrent/patches/patch-src_rpc_command.h
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- src/rpc/command.h.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/rpc/command.h
+@@ -41,13 +41,17 @@
+ #include <limits>
+ #include <inttypes.h>
+ #include <torrent/object.h>
+-#include <tr1/functional>
+
+ #include <torrent/object.h>
+ #include <torrent/data/file_list_iterator.h>
+
+ // Move into config.h or something.
+-namespace tr1 { using namespace std::tr1; }
++#if __cplusplus >= 201103L
++using std::function;
++#else
++#include <tr1/functional>
++using std::tr1::function;
++#endif
+
+ namespace core {
+ class Download;
+@@ -111,7 +115,7 @@ typedef rt_triple<int, void*, void*> tar
+ class command_base;
+
+ typedef const torrent::Object (*command_base_call_type)(command_base*,
target_type, const torrent::Object&);
+-typedef tr1::function<torrent::Object (target_type, const torrent::Object&)>
base_function;
++typedef function<torrent::Object (target_type, const torrent::Object&)>
base_function;
+
+ template <typename tmpl> struct command_base_is_valid {};
+ template <command_base_call_type tmpl_func> struct command_base_is_type {};
+@@ -250,7 +254,7 @@ command_base::_call(command_base* cmd, t
+ }
+
+ #define COMMAND_BASE_TEMPLATE_TYPE(func_type, func_parm) \
+- template <typename T, int proper = target_type_id<T>::proper_type> struct
func_type { typedef tr1::function<func_parm> type; }; \
++ template <typename T, int proper = target_type_id<T>::proper_type> struct
func_type { typedef function<func_parm> type; }; \
+ \
+ template <> struct command_base_is_valid<func_type<target_type>::type>
{ static const int value = 1; }; \
+ template <> struct command_base_is_valid<func_type<core::Download*>::type>
{ static const int value = 1; }; \
ADDED net/rtorrent/patches/patch-src_rpc_command__scheduler.cc
Index: net/rtorrent/patches/patch-src_rpc_command__scheduler.cc
==================================================================
--- net/rtorrent/patches/patch-src_rpc_command__scheduler.cc
+++ net/rtorrent/patches/patch-src_rpc_command__scheduler.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/rpc/command_scheduler.cc.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/rpc/command_scheduler.cc
+@@ -47,6 +47,14 @@
+ #include "command_scheduler_item.h"
+ #include "parse_commands.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace rpc {
+
+ CommandScheduler::~CommandScheduler() {
+@@ -71,7 +79,7 @@ CommandScheduler::insert(const std::stri
+ delete *itr;
+
+ *itr = new CommandSchedulerItem(key);
+- (*itr)->slot() = std::tr1::bind(&CommandScheduler::call_item, this, *itr);
++ (*itr)->slot() = bind(&CommandScheduler::call_item, this, *itr);
+
+ return itr;
+ }
ADDED net/rtorrent/patches/patch-src_rpc_command__scheduler__item.h
Index: net/rtorrent/patches/patch-src_rpc_command__scheduler__item.h
==================================================================
--- net/rtorrent/patches/patch-src_rpc_command__scheduler__item.h
+++ net/rtorrent/patches/patch-src_rpc_command__scheduler__item.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- src/rpc/command_scheduler_item.h.orig 2012-02-14 03:32:01.000000000
+0000
++++ src/rpc/command_scheduler_item.h
+@@ -39,14 +39,20 @@
+
+ #include "globals.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::function;
++#else
+ #include <tr1/functional>
++using std::tr1::function;
++#endif
+ #include <torrent/object.h>
+
+ namespace rpc {
+
+ class CommandSchedulerItem {
+ public:
+- typedef std::tr1::function<void ()> slot_void;
++ typedef function<void ()> slot_void;
+
+ CommandSchedulerItem(const std::string& key) : m_key(key), m_interval(0) {}
+ ~CommandSchedulerItem();
ADDED net/rtorrent/patches/patch-src_rpc_exec__file.cc
Index: net/rtorrent/patches/patch-src_rpc_exec__file.cc
==================================================================
--- net/rtorrent/patches/patch-src_rpc_exec__file.cc
+++ net/rtorrent/patches/patch-src_rpc_exec__file.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- src/rpc/exec_file.cc.orig 2012-01-19 10:18:01.000000000 +0000
++++ src/rpc/exec_file.cc
+@@ -52,6 +52,14 @@ namespace rpc {
+
+ // Close m_logFd.
+
++const unsigned int ExecFile::max_args = 128;
++const unsigned int ExecFile::buffer_size = 4096;
++
++const int ExecFile::flag_expand_tilde = 0x1;
++const int ExecFile::flag_throw = 0x2;
++const int ExecFile::flag_capture = 0x4;
++const int ExecFile::flag_background = 0x8;
++
+ int
+ ExecFile::execute(const char* file, char* const* argv, int flags) {
+ // Write the execued command and its parameters to the log fd.
ADDED net/rtorrent/patches/patch-src_rpc_exec__file.h
Index: net/rtorrent/patches/patch-src_rpc_exec__file.h
==================================================================
--- net/rtorrent/patches/patch-src_rpc_exec__file.h
+++ net/rtorrent/patches/patch-src_rpc_exec__file.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- src/rpc/exec_file.h.orig 2012-01-19 10:18:01.000000000 +0000
++++ src/rpc/exec_file.h
+@@ -43,13 +43,13 @@ namespace rpc {
+
+ class ExecFile {
+ public:
+- static const unsigned int max_args = 128;
+- static const unsigned int buffer_size = 4096;
++ static const unsigned int max_args;
++ static const unsigned int buffer_size;
+
+- static const int flag_expand_tilde = 0x1;
+- static const int flag_throw = 0x2;
+- static const int flag_capture = 0x4;
+- static const int flag_background = 0x8;
++ static const int flag_expand_tilde;
++ static const int flag_throw;
++ static const int flag_capture;
++ static const int flag_background;
+
+ ExecFile() : m_logFd(-1) {}
+
ADDED net/rtorrent/patches/patch-src_rpc_object__storage.cc
Index: net/rtorrent/patches/patch-src_rpc_object__storage.cc
==================================================================
--- net/rtorrent/patches/patch-src_rpc_object__storage.cc
+++ net/rtorrent/patches/patch-src_rpc_object__storage.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/rpc/object_storage.cc.orig 2013-08-31 16:44:50.000000000 +0000
++++ src/rpc/object_storage.cc
+@@ -42,6 +42,16 @@
+ #include "parse.h"
+ #include "parse_commands.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++using std::placeholders::_1;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++using std::tr1::placeholders::_1;
++#endif
++
+ namespace rpc {
+
+ object_storage::local_iterator
+@@ -246,7 +256,7 @@ object_storage::rlookup_list(const std::
+
+ if (r_itr != m_rlookup.end())
+ std::transform(r_itr->second.begin(), r_itr->second.end(),
std::back_inserter(result),
+- std::tr1::bind(&key_type::c_str,
std::tr1::bind(rak::mem_ptr(&value_type::first), std::tr1::placeholders::_1)));
++ bind(&key_type::c_str,
bind(rak::mem_ptr(&value_type::first), _1)));
+
+ return result;
+ }
ADDED net/rtorrent/patches/patch-src_rpc_object__storage.h
Index: net/rtorrent/patches/patch-src_rpc_object__storage.h
==================================================================
--- net/rtorrent/patches/patch-src_rpc_object__storage.h
+++ net/rtorrent/patches/patch-src_rpc_object__storage.h
@@ -0,0 +1,66 @@
+$NetBSD$
+
+--- src/rpc/object_storage.h.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/rpc/object_storage.h
+@@ -42,7 +42,13 @@
+ #define RTORRENT_RPC_OBJECT_STORAGE_H
+
+ #include <cstring>
++#if __cplusplus >= 201103L
++#include <unordered_map>
++using std::unordered_map;
++#else
+ #include <tr1/unordered_map>
++using std::tr1::unordered_map;
++#endif
+ #include <torrent/object.h>
+
+ #include "rak/unordered_vector.h"
+@@ -56,7 +62,7 @@ struct object_storage_node {
+ char flags;
+ };
+
+-typedef std::tr1::unordered_map<fixed_key_type<64>, object_storage_node,
hash_fixed_key_type> object_storage_base_type;
++typedef unordered_map<fixed_key_type<64>, object_storage_node,
hash_fixed_key_type> object_storage_base_type;
+
+ class object_storage : private object_storage_base_type {
+ public:
+@@ -89,21 +95,23 @@ public:
+ using base_type::clear;
+ using base_type::find;
+ using base_type::erase;
+-
+- static const unsigned int flag_generic_type = 0x1;
+- static const unsigned int flag_bool_type = 0x2;
+- static const unsigned int flag_value_type = 0x3;
+- static const unsigned int flag_string_type = 0x4;
+- static const unsigned int flag_list_type = 0x5;
+- static const unsigned int flag_function_type = 0x6;
+- static const unsigned int flag_multi_type = 0x7;
+-
+- static const unsigned int mask_type = 0xf;
+-
+- static const unsigned int flag_constant = 0x10;
+- static const unsigned int flag_static = 0x20;
+- static const unsigned int flag_private = 0x40;
+- static const unsigned int flag_rlookup = 0x80;
++
++ enum {
++ flag_generic_type = 0x1,
++ flag_bool_type = 0x2,
++ flag_value_type = 0x3,
++ flag_string_type = 0x4,
++ flag_list_type = 0x5,
++ flag_function_type = 0x6,
++ flag_multi_type = 0x7,
++
++ mask_type = 0xf,
++
++ flag_constant = 0x10,
++ flag_static = 0x20,
++ flag_private = 0x40,
++ flag_rlookup = 0x80
++ };
+
+ static const size_t key_size = key_type::max_size;
+
ADDED net/rtorrent/patches/patch-src_rpc_xmlrpc.h
Index: net/rtorrent/patches/patch-src_rpc_xmlrpc.h
==================================================================
--- net/rtorrent/patches/patch-src_rpc_xmlrpc.h
+++ net/rtorrent/patches/patch-src_rpc_xmlrpc.h
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- src/rpc/xmlrpc.h.orig 2012-02-14 03:32:01.000000000 +0000
++++ src/rpc/xmlrpc.h
+@@ -37,7 +37,12 @@
+ #ifndef RTORRENT_RPC_XMLRPC_H
+ #define RTORRENT_RPC_XMLRPC_H
+
++#if __cplusplus >= 201103L
++using std::function;
++#else
+ #include <tr1/functional>
++using std::tr1::function;
++#endif
+ #include <torrent/hash_string.h>
+
+ namespace core {
+@@ -54,11 +59,11 @@ namespace rpc {
+
+ class XmlRpc {
+ public:
+- typedef std::tr1::function<core::Download* (const char*)>
slot_download;
+- typedef std::tr1::function<torrent::File* (core::Download*, uint32_t)>
slot_file;
+- typedef std::tr1::function<torrent::Tracker* (core::Download*, uint32_t)>
slot_tracker;
+- typedef std::tr1::function<torrent::Peer* (core::Download*, const
torrent::HashString&)> slot_peer;
+- typedef std::tr1::function<bool (const char*, uint32_t)>
slot_write;
++ typedef function<core::Download* (const char*)>
slot_download;
++ typedef function<torrent::File* (core::Download*, uint32_t)> slot_file;
++ typedef function<torrent::Tracker* (core::Download*, uint32_t)>
slot_tracker;
++ typedef function<torrent::Peer* (core::Download*, const
torrent::HashString&)> slot_peer;
++ typedef function<bool (const char*, uint32_t)> slot_write;
+
+ static const int dialect_generic = 0;
+ static const int dialect_i8 = 1;
ADDED net/rtorrent/patches/patch-src_signal__handler.cc
Index: net/rtorrent/patches/patch-src_signal__handler.cc
==================================================================
--- net/rtorrent/patches/patch-src_signal__handler.cc
+++ net/rtorrent/patches/patch-src_signal__handler.cc
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/signal_handler.cc.orig 2012-03-29 13:06:11.000000000 +0000
++++ src/signal_handler.cc
+@@ -38,6 +38,7 @@
+
+ #include <signal.h>
+ #include <stdexcept>
++#include <string>
+ #include "rak/error_number.h"
+ #include "signal_handler.h"
+
ADDED net/rtorrent/patches/patch-src_thread__base.cc
Index: net/rtorrent/patches/patch-src_thread__base.cc
==================================================================
--- net/rtorrent/patches/patch-src_thread__base.cc
+++ net/rtorrent/patches/patch-src_thread__base.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- src/thread_base.cc.orig 2012-02-14 03:41:20.000000000 +0000
++++ src/thread_base.cc
+@@ -53,6 +53,14 @@
+ #include "control.h"
+ #include "core/manager.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ // Temporarly injected into config.h.
+ /* temp hack */
+ //#define lt_cacheline_aligned __attribute__((__aligned__(128)))
+@@ -109,7 +117,7 @@ public:
+ void throw_shutdown_exception() { throw torrent::shutdown_exception(); }
+
+ ThreadBase::ThreadBase() {
+- m_taskShutdown.slot() = std::tr1::bind(&throw_shutdown_exception);
++ m_taskShutdown.slot() = bind(&throw_shutdown_exception);
+
+ m_threadQueue = new thread_queue_hack;
+ }
ADDED net/rtorrent/patches/patch-src_ui_element__log__complete.cc
Index: net/rtorrent/patches/patch-src_ui_element__log__complete.cc
==================================================================
--- net/rtorrent/patches/patch-src_ui_element__log__complete.cc
+++ net/rtorrent/patches/patch-src_ui_element__log__complete.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/ui/element_log_complete.cc.orig 2012-03-13 12:10:49.000000000
+0000
++++ src/ui/element_log_complete.cc
+@@ -48,15 +48,23 @@
+ #include "control.h"
+ #include "element_log_complete.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#endif
++
+ namespace ui {
+
+ ElementLogComplete::ElementLogComplete(torrent::log_buffer* l) :
+ m_window(NULL),
+ m_log(l) {
+
+- unsigned int signal_index =
torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&ElementLogComplete::received_update,
this));
++ unsigned int signal_index =
torrent::main_thread()->signal_bitfield()->add_signal(bind(&ElementLogComplete::received_update,
this));
+
+-
m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal,
torrent::main_thread(), signal_index, false));
++
m_log->lock_and_set_update_slot(bind(&torrent::thread_base::send_event_signal,
torrent::main_thread(), signal_index, false));
+ }
+
+ void
ADDED net/rtorrent/patches/patch-src_ui_element__peer__list.cc
Index: net/rtorrent/patches/patch-src_ui_element__peer__list.cc
==================================================================
--- net/rtorrent/patches/patch-src_ui_element__peer__list.cc
+++ net/rtorrent/patches/patch-src_ui_element__peer__list.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- src/ui/element_peer_list.cc.orig 2012-04-09 06:39:14.000000000 +0000
++++ src/ui/element_peer_list.cc
+@@ -54,6 +54,16 @@
+ #include "element_peer_list.h"
+ #include "element_text.h"
+
++#if __cplusplus >= 201103L
++#include <functional>
++using std::bind;
++#define STD_PLACEHOLDERS std::placeholders
++#else
++#include <tr1/functional>
++using std::tr1::bind;
++#define STD_PLACEHOLDERS std::tr1::placeholders
++#endif
++
+ namespace ui {
+
+ ElementPeerList::ElementPeerList(core::Download* d) :
+@@ -68,9 +78,9 @@ ElementPeerList::ElementPeerList(core::D
+ torrent::ConnectionList* connection_list =
m_download->download()->connection_list();
+
+ m_peer_connected =
connection_list->signal_connected().insert(connection_list->signal_connected().end(),
+-
tr1::bind(&ElementPeerList::receive_peer_connected, this,
tr1::placeholders::_1));
++
bind(&ElementPeerList::receive_peer_connected, this, STD_PLACEHOLDERS::_1));
+ m_peer_disconnected =
connection_list->signal_disconnected().insert(connection_list->signal_disconnected().end(),
+-
tr1::bind(&ElementPeerList::receive_peer_disconnected, this,
tr1::placeholders::_1));
++
bind(&ElementPeerList::receive_peer_disconnected, this, STD_PLACEHOLDERS::_1));
+
+ m_windowList = new display::WindowPeerList(m_download, &m_list,
&m_listItr);
+ m_elementInfo = create_info();
Home |
Main Index |
Thread Index |
Old Index