diff --git a/rak/functional_fun.h b/rak/functional_fun.h index 5322a562..cc1ee5f2 100644 --- a/rak/functional_fun.h +++ b/rak/functional_fun.h @@ -53,6 +53,8 @@ #include #include +#include +#include namespace rak { @@ -96,13 +98,13 @@ public: bool is_valid() const { return m_base.get() != NULL; } - void set(base_type* base) { m_base = std::shared_ptr(base); } + void set(base_type* base) { m_base = std::tr1::shared_ptr(base); } base_type* release() { return m_base.release(); } Result operator () () { return (*m_base)(); } private: - std::shared_ptr m_base; + std::tr1::shared_ptr m_base; }; template @@ -113,13 +115,13 @@ public: bool is_valid() const { return m_base.get() != NULL; } - void set(base_type* base) { m_base = std::shared_ptr(base); } + void set(base_type* base) { m_base = std::tr1::shared_ptr(base); } base_type* release() { return m_base.release(); } Result operator () (Arg1 arg1) { return (*m_base)(arg1); } private: - std::shared_ptr m_base; + std::tr1::shared_ptr m_base; }; template @@ -130,13 +132,13 @@ public: bool is_valid() const { return m_base.get() != NULL; } - void set(base_type* base) { m_base = std::shared_ptr(base); } + void set(base_type* base) { m_base = std::tr1::shared_ptr(base); } base_type* release() { return m_base.release(); } Result operator () (Arg1 arg1, Arg2 arg2) { return (*m_base)(arg1, arg2); } private: - std::shared_ptr m_base; + std::tr1::shared_ptr m_base; }; template @@ -147,7 +149,7 @@ public: bool is_valid() const { return m_base.get() != NULL; } - void set(base_type* base) { m_base = std::shared_ptr(base); } + void set(base_type* base) { m_base = std::tr1::shared_ptr(base); } base_type* release() { return m_base.release(); } Result operator () (Arg2 arg2) { return (*m_base)(arg2); } @@ -156,7 +158,7 @@ public: Result operator () (Discard discard, Arg2 arg2) { return (*m_base)(arg2); } private: - std::shared_ptr m_base; + std::tr1::shared_ptr m_base; }; template @@ -167,13 +169,13 @@ public: bool is_valid() const { return m_base.get() != NULL; } - void set(base_type* base) { m_base = std::shared_ptr(base); } + void set(base_type* base) { m_base = std::tr1::shared_ptr(base); } base_type* release() { return m_base.release(); } Result operator () (Arg1 arg1, Arg2 arg2, Arg3 arg3) { return (*m_base)(arg1, arg2, arg3); } private: - std::shared_ptr m_base; + std::tr1::shared_ptr m_base; }; template diff --git a/src/command_helpers.h b/src/command_helpers.h index 3b55312e..8b290ced 100644 --- a/src/command_helpers.h +++ b/src/command_helpers.h @@ -41,6 +41,10 @@ #include "rpc/parse_commands.h" #include "rpc/object_storage.h" +#ifndef HAVE_CXX11 +namespace std { using namespace tr1; } +#endif + void initialize_commands(); // diff --git a/src/rpc/command.h b/src/rpc/command.h index 4a83eea1..db4b2eaf 100644 --- a/src/rpc/command.h +++ b/src/rpc/command.h @@ -111,7 +111,7 @@ typedef rt_triple target_type; class command_base; typedef const torrent::Object (*command_base_call_type)(command_base*, target_type, const torrent::Object&); -typedef std::function base_function; +typedef tr1::function base_function; template struct command_base_is_valid {}; template struct command_base_is_type {}; @@ -250,7 +250,7 @@ command_base::_call(command_base* cmd, target_type target, Args args) { } #define COMMAND_BASE_TEMPLATE_TYPE(func_type, func_parm) \ - template ::proper_type> struct func_type { typedef std::function type; }; \ + template ::proper_type> struct func_type { typedef tr1::function type; }; \ \ template <> struct command_base_is_valid::type> { static const int value = 1; }; \ template <> struct command_base_is_valid::type> { static const int value = 1; }; \