diff options
author | Stanislav Ochotnicky <sochotnicky@gentoo.org> | 2012-03-09 00:15:08 +0000 |
---|---|---|
committer | Stanislav Ochotnicky <sochotnicky@gentoo.org> | 2012-03-09 00:15:08 +0000 |
commit | 0b426778fe1cfc0958c7ee8b89f2c1d412847762 (patch) | |
tree | fbbfb28fa87ce0c5e5c3357804943793bd2c8cfa /net-p2p/rtorrent/files | |
parent | Revbump: ebuild rewritten to support multiple python ABIs (bug #401549). (diff) | |
download | historical-0b426778fe1cfc0958c7ee8b89f2c1d412847762.tar.gz historical-0b426778fe1cfc0958c7ee8b89f2c1d412847762.tar.bz2 historical-0b426778fe1cfc0958c7ee8b89f2c1d412847762.zip |
Fix build problems with clang
Package-Manager: portage-2.1.10.44/cvs/Linux x86_64
Diffstat (limited to 'net-p2p/rtorrent/files')
-rw-r--r-- | net-p2p/rtorrent/files/rtorrent-0.9.0-clang.patch | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.0-clang.patch b/net-p2p/rtorrent/files/rtorrent-0.9.0-clang.patch new file mode 100644 index 000000000000..e3bed62ea03b --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent-0.9.0-clang.patch @@ -0,0 +1,136 @@ +From e58f3975f128f68638843a11b40a239350bf88f4 Mon Sep 17 00:00:00 2001 +From: Jari Sundell <sundell.software@gmail.com> +Date: Thu, 29 Dec 2011 18:58:12 +0900 +Subject: [PATCH] Fixed compiler issues with clang. + +--- + src/command_download.cc | 9 ++++----- + src/command_dynamic.cc | 6 +++--- + src/command_helpers.h | 11 +++++++++-- + src/display/window_file_list.cc | 2 +- + src/thread_base.h | 4 +--- + 5 files changed, 18 insertions(+), 14 deletions(-) + +diff --git a/src/command_download.cc b/src/command_download.cc +index 30abb4d..bc58b9a 100644 +--- a/src/command_download.cc ++++ b/src/command_download.cc +@@ -138,10 +138,9 @@ apply_d_change_link(core::Download* download, const torrent::Object::list_type& + + switch (changeType) { + case 0: +- if (symlink(target.c_str(), link.c_str()) == -1) ++ // if (symlink(target.c_str(), link.c_str()) == -1) + // control->core()->push_log("create_link failed: " + std::string(rak::error_number::current().c_str())); + // control->core()->push_log("create_link failed: " + std::string(rak::error_number::current().c_str()) + " to " + target); +- ; // Disabled. + break; + + case 1: +@@ -150,9 +149,9 @@ apply_d_change_link(core::Download* download, const torrent::Object::list_type& + rak::error_number::clear_global(); + + if (!fileStat.update_link(link) || !fileStat.is_link() || +- unlink(link.c_str()) == -1) +- ; // control->core()->push_log("delete_link failed: " + std::string(rak::error_number::current().c_str())); +- ++ unlink(link.c_str()) == -1) { ++ // control->core()->push_log("delete_link failed: " + std::string(rak::error_number::current().c_str())); ++ } + break; + } + default: +diff --git a/src/command_dynamic.cc b/src/command_dynamic.cc +index 6e83454..013f855 100644 +--- a/src/command_dynamic.cc ++++ b/src/command_dynamic.cc +@@ -156,7 +156,7 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) { + (flags & rpc::object_storage::mask_type) == rpc::object_storage::flag_multi_type) { + + rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type> >::type> +- (create_new_key<0>(rawKey, ""), ++ (create_new_key(rawKey), + 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>, +@@ -164,7 +164,7 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) { + + } else { + rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type> >::type> +- (create_new_key<0>(rawKey, ""), ++ (create_new_key(rawKey), + std::bind(&rpc::object_storage::get_str, control->object_storage(), rawKey), + &rpc::command_base_call<rpc::target_type>, + cmd_flags, NULL, NULL); +@@ -354,7 +354,7 @@ system_method_redirect(const torrent::Object::list_type& args) { + std::string new_key = torrent::object_create_string(args.front()); + std::string dest_key = torrent::object_create_string(args.back()); + +- rpc::commands.create_redirect(create_new_key<0>(new_key, ""), create_new_key<0>(dest_key, ""), ++ rpc::commands.create_redirect(create_new_key(new_key), create_new_key(dest_key), + rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_delete_key | rpc::CommandMap::flag_modifiable); + + return torrent::Object(); +diff --git a/src/command_helpers.h b/src/command_helpers.h +index 8b290ce..b215ec2 100644 +--- a/src/command_helpers.h ++++ b/src/command_helpers.h +@@ -152,11 +152,11 @@ void initialize_commands(); + rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_tracker_target | rpc::CommandMap::flag_dont_delete); + + #define CMD2_REDIRECT_GENERIC_STR(from_key, to_key) \ +- rpc::commands.create_redirect(create_new_key<0>(from_key, ""), create_new_key<0>(to_key, ""), \ ++ rpc::commands.create_redirect(create_new_key(from_key), create_new_key(to_key), \ + rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_no_target | rpc::CommandMap::flag_delete_key); + + #define CMD2_REDIRECT_GENERIC_STR_NO_EXPORT(from_key, to_key) \ +- rpc::commands.create_redirect(create_new_key<0>(from_key, ""), create_new_key<0>(to_key, ""), \ ++ rpc::commands.create_redirect(create_new_key(from_key), create_new_key(to_key), \ + rpc::CommandMap::flag_no_target | rpc::CommandMap::flag_delete_key); + + // +@@ -205,4 +205,11 @@ create_new_key(const std::string& key, const char postfix[postfix_size]) { + return buffer; + } + ++inline const char* ++create_new_key(const std::string& key) { ++ char *buffer = new char[key.size() + 1]; ++ std::memcpy(buffer, key.c_str(), key.size() + 1); ++ return buffer; ++} ++ + #endif +diff --git a/src/display/window_file_list.cc b/src/display/window_file_list.cc +index 6a923dc..7c9f692 100644 +--- a/src/display/window_file_list.cc ++++ b/src/display/window_file_list.cc +@@ -123,7 +123,7 @@ WindowFileList::redraw() { + if (fl->size_files() == 0 || m_canvas->height() < 2) + return; + +- iterator entries[m_canvas->height() - 1]; ++ std::vector<iterator> entries(m_canvas->height() - 1); + + unsigned int last = 0; + +diff --git a/src/thread_base.h b/src/thread_base.h +index 4cd38de..479e3cd 100644 +--- a/src/thread_base.h ++++ b/src/thread_base.h +@@ -44,11 +44,9 @@ + #include "rak/priority_queue_default.h" + #include "core/poll_manager.h" + +-struct thread_queue_hack; +- + // Move this class to libtorrent. + +-struct thread_queue_hack; ++class thread_queue_hack; + + class ThreadBase : public torrent::thread_base { + public: +-- +1.7.3.4 + |