C++11 compatibility fixes.

This commit is contained in:
rakshasa
2014-05-13 23:36:37 +09:00
parent e42ec54920
commit 3b39f37f49
77 changed files with 886 additions and 803 deletions
+3 -5
View File
@@ -41,14 +41,12 @@
#include <limits>
#include <inttypes.h>
#include <torrent/object.h>
#include <tr1/functional>
#include lt_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; }
namespace core {
class Download;
}
@@ -111,7 +109,7 @@ typedef rt_triple<int, void*, void*> target_type;
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 std::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 +248,7 @@ command_base::_call(command_base* cmd, target_type target, Args args) {
}
#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 std::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; }; \