diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/tools | |
parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
download | swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/tools')
-rw-r--r-- | 3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp | 6 | ||||
-rw-r--r-- | 3rdParty/Boost/src/tools/bcp/copy_path.cpp | 43 | ||||
-rw-r--r-- | 3rdParty/Boost/src/tools/bcp/fileview.cpp | 7 |
3 files changed, 29 insertions, 27 deletions
diff --git a/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp b/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp index bb1818a..41cc597 100644 --- a/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp +++ b/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp @@ -49,125 +49,125 @@ static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::st // Don't add version control directories: // if((p.leaf() == "CVS") || (p.leaf() == ".svn")) return; // // don't add directories not under version control: // if(cvs_mode && !fs::exists(p / "CVS/Entries")) return; if(cvs_mode && !fs::exists(p / ".svn/entries")) return; // // Enumerate files and directories: // fs::directory_iterator i(p); fs::directory_iterator j; while(i != j) { if(fs::is_directory(*i)) init_library_scanner(*i, cvs_mode, libname, true); if(bcp_implementation::is_source_file(*i)) { static boost::regex function_scanner( "(?|" // Branch reset group "(?:\\<\\w+\\>[^>;{},:]*)" // Return type "(?:" "(\\<\\w+\\>)" // Maybe class name "\\s*" "(?:<[^>;{]*>)?" // Maybe template specialisation "::\\s*)?" "(\\<(?!throw|if|while|for|catch)\\w+\\>)" // function name "\\s*" "\\(" "[^\\(\\);{}]*" // argument list "\\)" - "\\s*" + "\\s*(?:BOOST[_A-Z]+\\s*)?" "\\{" // start of definition "|" "(\\<\\w+\\>)" // Maybe class name "\\s*" "(?:<[^>;{]*>)?" // Maybe template specialisation "::\\s*" "~?\\1" // function name, same as class name "\\s*" "\\(" "[^\\(\\);{}]*" // argument list "\\)" - "\\s*" + "\\s*(?:BOOST[_A-Z]+\\s*)?" "\\{" // start of definition ")" // end branch reset ); fileview view(*i); boost::regex_iterator<const char*> a(view.begin(), view.end(), function_scanner); boost::regex_iterator<const char*> b; while(a != b) { if((*a)[1].matched) { std::string n = a->str(1); class_names[libname].insert(n); } else { std::string n = a->str(2); free_function_names[libname].insert(n); } ++a; } } ++i; } if(recurse == false) { // // Build the regular expressions: // const char* e1 = "^(?>[[:blank:]]*)(?!#)[^;{}\\r\\n]*" "(?|" "(?:class|struct)[^:;{}#]*" "("; // list of class names goes here... const char* e2 = ")\\s*(?:<[^;{>]*>\\s*)?(?::[^;{]*)?\\{" "|" "\\<(?!return)\\w+\\>[^:;{}#=<>!~%.\\w]*("; // List of function names goes here... const char* e3 = - ")\\s*\\([^;()]*\\)\\s*;)"; + ")\\s*\\([^;()]*\\)\\s*(?:BOOST[_A-Z]+\\s*)?;)"; std::string class_name_list; std::set<std::string>::const_iterator i = class_names[libname].begin(), j = class_names[libname].end(); if(i != j) { class_name_list = *i; ++i; while(i != j) { class_name_list += "|" + *i; ++i; } } else { class_name_list = "[\\x0]"; } std::string function_name_list; i = free_function_names[libname].begin(); j = free_function_names[libname].end(); if(i != j) { function_name_list = *i; ++i; while(i != j) { function_name_list += "|" + *i; ++i; } } else { function_name_list = "[\\x0]"; } diff --git a/3rdParty/Boost/src/tools/bcp/copy_path.cpp b/3rdParty/Boost/src/tools/bcp/copy_path.cpp index 497dcd5..ded5d18 100644 --- a/3rdParty/Boost/src/tools/bcp/copy_path.cpp +++ b/3rdParty/Boost/src/tools/bcp/copy_path.cpp @@ -1,244 +1,245 @@ /* * * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * * This file implements the following: * void bcp_implementation::copy_path(const fs::path& p) * void bcp_implementation::create_path(const fs::path& p) */ #include "bcp_imp.hpp" #include "fileview.hpp" #include <boost/filesystem/operations.hpp> +#include <boost/filesystem/fstream.hpp> #include <boost/regex.hpp> #include <fstream> #include <iterator> #include <algorithm> #include <iostream> struct get_new_library_name -{ +{ get_new_library_name(const std::string& n) : m_new_name(n) {} template <class I> std::string operator()(const boost::match_results<I>& what) { std::string s = what[0]; std::string::size_type n = s.find("boost"); if(n == std::string::npos) { s.insert(0, m_new_name); } else { s.replace(n, 5, m_new_name); } return s; } private: std::string m_new_name; }; void bcp_implementation::copy_path(const fs::path& p) { assert(!fs::is_directory(m_boost_path / p)); if(fs::exists(m_dest_path / p)) { std::cout << "Copying (and overwriting) file: " << p.string() << "\n"; fs::remove(m_dest_path / p); } else std::cout << "Copying file: " << p.string() << "\n"; // // create the path to the new file if it doesn't already exist: // create_path(p.branch_path()); // // do text based copy if requested: // if(p.leaf() == "Jamroot") { static std::vector<char> v1, v2; v1.clear(); v2.clear(); - std::ifstream is((m_boost_path / p).c_str()); + boost::filesystem::ifstream is((m_boost_path / p)); std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1)); static boost::regex libname_matcher; if(libname_matcher.empty()) { libname_matcher.assign("boost_"); } regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, m_namespace_name + "_"); std::swap(v1, v2); v2.clear(); - std::ofstream os; + boost::filesystem::ofstream os; if(m_unix_lines) - os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); else - os.open((m_dest_path / p).c_str(), std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::out); os.write(&*v1.begin(), v1.size()); os.close(); } else if(m_namespace_name.size() && m_lib_names.size() && is_jam_file(p)) { static std::vector<char> v1, v2; v1.clear(); v2.clear(); - std::ifstream is((m_boost_path / p).c_str()); + boost::filesystem::ifstream is((m_boost_path / p)); std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1)); static boost::regex libname_matcher; if(libname_matcher.empty()) { std::string re = "\\<"; re += *m_lib_names.begin(); for(std::set<std::string>::const_iterator i = ++m_lib_names.begin(); i != m_lib_names.end(); ++i) { re += "|" + *i; } re += "\\>"; libname_matcher.assign(re); } regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, get_new_library_name(m_namespace_name)); std::swap(v1, v2); v2.clear(); - std::ofstream os; + boost::filesystem::ofstream os; if(m_unix_lines) - os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); else - os.open((m_dest_path / p).c_str(), std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::out); os.write(&*v1.begin(), v1.size()); os.close(); } else if(m_namespace_name.size() && is_source_file(p)) { // // v1 hold the current content, v2 is temp buffer. - // Each time we do a search and replace the new content + // Each time we do a search and replace the new content // ends up in v2: we then swap v1 and v2, and clear v2. // static std::vector<char> v1, v2; v1.clear(); v2.clear(); - std::ifstream is((m_boost_path / p).c_str()); + boost::filesystem::ifstream is((m_boost_path / p)); std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1)); static const boost::regex namespace_matcher( "(?|" "(namespace\\s+)boost(_\\w+)?(?:(\\s*::\\s*)phoenix)?" "|" "(namespace\\s+(?:detail::)?)(adstl|phoenix|rapidxml)\\>" "|" "()\\<boost((?:_(?!intrusive_tags)\\w+)?\\s*(?:::))(?:(\\s*)phoenix)?" "|" "()\\<((?:adstl|phoenix|rapidxml)\\s*(?:::))" "|" "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?)boost(_\\w+)?(?:(\\s*::\\s*)phoenix)?" "|" "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?(?:\\w+\\s*::\\s*)?)(adstl|phoenix|rapidxml)\\>" "|" "(^\\s*#\\s*define\\s+\\w+\\s+)boost((?:_\\w+)?\\s*)$" "|" "(^\\s*#\\s*define[^\\n]+)((?:adstl|phoenix|rapidxml)\\s*)$" "|" "()boost(_asio_detail_posix_thread_function|_regex_free_static_mutex)" "|" "()(lw_thread_routine|at_thread_exit|on_process_enter|on_process_exit|on_thread_enter|on_thread_exit|tss_cleanup_implemented)" "|" "(BOOST_CLASS_REQUIRE4?[^;]*)boost((?:_\\w+)?\\s*,)" "|" "(::tr1::|TR1_DECL\\s+)boost(_\\w+\\s*)" // math tr1 "|" "(\\(\\s*)boost(\\s*\\))\\s*(\\(\\s*)phoenix(\\s*\\))" "|" "(\\(\\s*)boost(\\s*\\))" ")" ); regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_matcher, "$1" + m_namespace_name + "$2(?3$3" + m_namespace_name + "phoenix?4$4)", boost::regex_constants::format_all); std::swap(v1, v2); v2.clear(); if(m_namespace_alias) { static const boost::regex namespace_alias( /* - "namespace\\s+" + m_namespace_name + + "namespace\\s+" + m_namespace_name + "\\s*" "(" "\\{" "(?:" "(?>[^\\{\\}/]+)" "(?>" "(?:" "(?1)" "|//[^\\n]+$" "|/[^/]" "|(?:^\\s*#[^\\n]*" "(?:(?<=\\\\)\\n[^\\n]*)*)" ")" "[^\\{\\}]+" ")*" ")*" "\\}" ")" */ /* - "(namespace\\s+" + m_namespace_name + + "(namespace\\s+" + m_namespace_name + "\\s*\\{.*" "\\})([^\\{\\};]*)\\z" */ "(namespace)(\\s+)(" + m_namespace_name + ")" "(adstl|phoenix|rapidxml)?(\\s*\\{)" ); - regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, "$1 $3$4 {} $1 (?4$4:boost) = $3$4; $1$2$3$4$5", boost::regex_constants::format_all); std::swap(v1, v2); v2.clear(); } - std::ofstream os; + boost::filesystem::ofstream os; if(m_unix_lines) - os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::binary | std::ios_base::out); else - os.open((m_dest_path / p).c_str(), std::ios_base::out); + os.open((m_dest_path / p), std::ios_base::out); if(v1.size()) os.write(&*v1.begin(), v1.size()); os.close(); } else if(m_unix_lines && !is_binary_file(p)) { - std::ifstream is((m_boost_path / p).c_str()); + boost::filesystem::ifstream is((m_boost_path / p)); std::istreambuf_iterator<char> isi(is); std::istreambuf_iterator<char> end; - std::ofstream os((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out); + boost::filesystem::ofstream os((m_dest_path / p), std::ios_base::binary | std::ios_base::out); std::ostreambuf_iterator<char> osi(os); std::copy(isi, end, osi); } else { // binary copy: fs::copy_file(m_boost_path / p, m_dest_path / p); } } void bcp_implementation::create_path(const fs::path& p) { if(!fs::exists(m_dest_path / p)) { // recurse then create the path: create_path(p.branch_path()); fs::create_directory(m_dest_path / p); } } diff --git a/3rdParty/Boost/src/tools/bcp/fileview.cpp b/3rdParty/Boost/src/tools/bcp/fileview.cpp index 54b3758..36e7850 100644 --- a/3rdParty/Boost/src/tools/bcp/fileview.cpp +++ b/3rdParty/Boost/src/tools/bcp/fileview.cpp @@ -1,95 +1,96 @@ /* * * Copyright (c) 2003 Dr John Maddock - * Use, modification and distribution is subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * * This file implements the fileview class */ #include "fileview.hpp" +#include <boost/filesystem/fstream.hpp> #include <vector> #include <algorithm> #include <string> #include <fstream> #include <istream> #include <stdexcept> struct fileview::implementation { std::vector<char> m_data; }; // construct: fileview::fileview() { pimpl.reset(new implementation()); } fileview::fileview(const boost::filesystem::path& p) { pimpl.reset(new implementation()); open(p); } fileview::~fileview() { } fileview::fileview(const fileview& ) { } fileview& fileview::operator=(const fileview& that) { pimpl = that.pimpl; return *this; } void fileview::close() { cow(); pimpl->m_data.clear(); } void fileview::open(const boost::filesystem::path& p) { cow(); - std::ifstream is(p.c_str()); + boost::filesystem::ifstream is(p); if(!is) { std::string msg("Bad file name: "); msg += p.string(); std::runtime_error e(msg); boost::throw_exception(e); } std::istreambuf_iterator<char> in(is); std::istreambuf_iterator<char> end; std::copy(in, end, std::back_inserter(pimpl->m_data)); } // iterators: fileview::const_iterator fileview::begin() const { return pimpl->m_data.size() ? &(pimpl->m_data[0]) : 0; } fileview::const_iterator fileview::end() const { return begin() + pimpl->m_data.size(); } #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION fileview::const_reverse_iterator fileview::rbegin() const { return const_reverse_iterator(end()); } fileview::const_reverse_iterator fileview::rend() const { return const_reverse_iterator(begin()); } #endif |