diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-14 18:35:17 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-03-14 18:35:17 (GMT) |
commit | a135c6ff4dcded5661a2321512960b14cf8c15c8 (patch) | |
tree | b0017ecfe702304f592b9d4e8b943784cff26fb2 /3rdParty/Boost/src/boost/filesystem/v2 | |
parent | 02d6188ab335e6c62b8341b84579d9549d215118 (diff) | |
download | swift-a135c6ff4dcded5661a2321512960b14cf8c15c8.zip swift-a135c6ff4dcded5661a2321512960b14cf8c15c8.tar.bz2 |
Updated Boost to 1.46.1.
This should hopefuily fix a hang on shutdown on Mac OS X.
Resolves: #782
Release-Notes: Fixed a potential hang on shutdown on Mac OS X.
Diffstat (limited to '3rdParty/Boost/src/boost/filesystem/v2')
5 files changed, 50 insertions, 38 deletions
diff --git a/3rdParty/Boost/src/boost/filesystem/v2/config.hpp b/3rdParty/Boost/src/boost/filesystem/v2/config.hpp index 62656ef..7116de5 100644 --- a/3rdParty/Boost/src/boost/filesystem/v2/config.hpp +++ b/3rdParty/Boost/src/boost/filesystem/v2/config.hpp @@ -51,6 +51,16 @@ # endif # endif +// throw an exception ----------------------------------------------------------------// +// +// Exceptions were originally thrown via boost::throw_exception(). +// As throw_exception() became more complex, it caused user error reporting +// to be harder to interpret, since the exception reported became much more complex. +// The immediate fix was to throw directly, wrapped in a macro to make any later change +// easier. + +#define BOOST_FILESYSTEM_THROW(EX) throw EX + // narrow support only for badly broken compilers or libraries -------------// # if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE) || BOOST_WORKAROUND(__BORLANDC__, <0x610) diff --git a/3rdParty/Boost/src/boost/filesystem/v2/convenience.hpp b/3rdParty/Boost/src/boost/filesystem/v2/convenience.hpp index 4695a01..30b6ade 100644 --- a/3rdParty/Boost/src/boost/filesystem/v2/convenience.hpp +++ b/3rdParty/Boost/src/boost/filesystem/v2/convenience.hpp @@ -13,7 +13,8 @@ #ifndef BOOST_FILESYSTEM2_CONVENIENCE_HPP #define BOOST_FILESYSTEM2_CONVENIENCE_HPP -#include <boost/filesystem/operations.hpp> +#include <boost/filesystem/v2/config.hpp> +#include <boost/filesystem/v2/operations.hpp> #include <boost/system/error_code.hpp> #include <vector> #include <stack> @@ -85,11 +86,11 @@ namespace boost # if !defined(_STLPORT_VERSION) return ph.parent_path() / (basename(ph) + new_extension); # else - typedef BOOST_FS_TYPENAME Path::string_type string_type; - string_type filename = basename(ph) + new_extension; - return ph.parent_path() / filename; + typedef BOOST_FS_TYPENAME Path::string_type string_type; + string_type filename = basename(ph) + new_extension; + return ph.parent_path() / filename; # endif - } + } # endif # ifndef BOOST_FILESYSTEM2_NARROW_ONLY diff --git a/3rdParty/Boost/src/boost/filesystem/v2/fstream.hpp b/3rdParty/Boost/src/boost/filesystem/v2/fstream.hpp index bdcd485..887d59d 100644 --- a/3rdParty/Boost/src/boost/filesystem/v2/fstream.hpp +++ b/3rdParty/Boost/src/boost/filesystem/v2/fstream.hpp @@ -12,6 +12,7 @@ #ifndef BOOST_FILESYSTEM2_FSTREAM_HPP #define BOOST_FILESYSTEM2_FSTREAM_HPP +#include <boost/filesystem/v2/config.hpp> #include <boost/filesystem/v2/operations.hpp> // for 8.3 hack (see below) #include <boost/utility/enable_if.hpp> #include <boost/detail/workaround.hpp> diff --git a/3rdParty/Boost/src/boost/filesystem/v2/operations.hpp b/3rdParty/Boost/src/boost/filesystem/v2/operations.hpp index c60046f..57c406d 100644 --- a/3rdParty/Boost/src/boost/filesystem/v2/operations.hpp +++ b/3rdParty/Boost/src/boost/filesystem/v2/operations.hpp @@ -14,6 +14,7 @@ #ifndef BOOST_FILESYSTEM2_OPERATIONS_HPP #define BOOST_FILESYSTEM2_OPERATIONS_HPP +#include <boost/filesystem/v2/config.hpp> #include <boost/filesystem/v2/path.hpp> #include <boost/detail/scoped_enum_emulation.hpp> @@ -258,7 +259,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::status", ph, ec ) ); return result; } @@ -277,7 +278,7 @@ namespace boost system::error_code ec; file_status result( symlink_status( ph, ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::symlink_status", ph, ec ) ); return result; } @@ -292,7 +293,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::exists", ph, ec ) ); return exists( result ); } @@ -302,7 +303,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_directory", ph, ec ) ); return is_directory( result ); } @@ -312,7 +313,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_regular_file", ph, ec ) ); return is_regular_file( result ); } @@ -323,7 +324,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_regular", ph, ec ) ); return is_regular( result ); } @@ -334,7 +335,7 @@ namespace boost system::error_code ec; file_status result( detail::status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_other", ph, ec ) ); return is_other( result ); } @@ -350,7 +351,7 @@ namespace boost system::error_code ec; file_status result( detail::symlink_status_api( ph.external_file_string(), ec ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_symlink", ph, ec ) ); return is_symlink( result ); # endif @@ -369,7 +370,7 @@ namespace boost detail::query_pair result( detail::is_empty_api( ph.external_file_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::is_empty", ph, result.first ) ); return result.second; } @@ -379,7 +380,7 @@ namespace boost detail::query_pair result( detail::equivalent_api( ph1.external_file_string(), ph2.external_file_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::equivalent", ph1, ph2, result.first ) ); return result.second; } @@ -389,7 +390,7 @@ namespace boost detail::uintmax_pair result ( detail::file_size_api( ph.external_file_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::file_size", ph, result.first ) ); return result.second; } @@ -399,7 +400,7 @@ namespace boost detail::space_pair result ( detail::space_api( ph.external_file_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::space", ph, result.first ) ); return result.second; } @@ -409,7 +410,7 @@ namespace boost detail::time_pair result ( detail::last_write_time_api( ph.external_file_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::last_write_time", ph, result.first ) ); return result.second; } @@ -422,7 +423,7 @@ namespace boost detail::query_pair result( detail::create_directory_api( dir_ph.external_directory_string() ) ); if ( result.first ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::create_directory", dir_ph, result.first ) ); return result.second; @@ -437,7 +438,7 @@ namespace boost to_ph.external_file_string(), from_ph.external_file_string() ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::create_hard_link", to_ph, from_ph, ec ) ); } @@ -461,7 +462,7 @@ namespace boost to_ph.external_file_string(), from_ph.external_file_string() ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::create_symlink", to_ph, from_ph, ec ) ); } @@ -481,7 +482,7 @@ namespace boost system::error_code ec; file_status f = symlink_status( ph, ec ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::remove", ph, ec ) ); return detail::remove_aux( ph, f ); } @@ -491,7 +492,7 @@ namespace boost system::error_code ec; file_status f = symlink_status( ph, ec ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::remove_all", ph, ec ) ); return exists( f ) ? detail::remove_all_aux( ph, f ) : 0; } @@ -502,7 +503,7 @@ namespace boost from_path.external_directory_string(), to_path.external_directory_string() ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::rename", from_path, to_path, ec ) ); } @@ -518,7 +519,7 @@ namespace boost from_path.external_directory_string(), to_path.external_directory_string(), option == copy_option::fail_if_exists ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::copy_file", from_path, to_path, ec ) ); } @@ -529,7 +530,7 @@ namespace boost typename Path::external_string_type ph; system::error_code ec( detail::get_current_path_api( ph ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::current_path", ec ) ); return Path( Path::traits_type::to_internal( ph ) ); } @@ -539,7 +540,7 @@ namespace boost system::error_code ec( detail::set_current_path_api( ph.external_directory_string() ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::current_path", ph, ec ) ); } @@ -567,7 +568,7 @@ namespace boost system::error_code ec( detail::get_full_path_name_api( ph.external_file_string(), sys_ph ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::system_complete", ph, ec ) ); return Path( Path::traits_type::to_internal( sys_ph ) ); # else @@ -606,7 +607,7 @@ namespace boost system::error_code ec( detail::last_write_time_api( ph.external_file_string(), new_time ) ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::last_write_time", ph, ec ) ); } @@ -782,7 +783,7 @@ namespace boost { system::error_code ec = remove_api( ph.external_file_string() ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::remove", ph, ec ) ); return true; } @@ -803,7 +804,7 @@ namespace boost boost::system::error_code ec; boost::filesystem2::file_status fn = boost::filesystem2::symlink_status( itr->path(), ec ); if ( ec ) - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem:remove_all", ph, ec ) ); count += remove_all_aux( itr->path(), fn ); } @@ -980,7 +981,7 @@ namespace boost system::error_code ec( m_init(dir_path) ); if ( ec ) { - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::basic_directory_iterator constructor", dir_path, ec ) ); } @@ -1013,7 +1014,7 @@ namespace boost name, fs, symlink_fs ); if ( ec ) { - boost::throw_exception( basic_filesystem_error<Path>( + BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>( "boost::filesystem::basic_directory_iterator increment", m_imp->m_directory_entry.path().parent_path(), ec ) ); } diff --git a/3rdParty/Boost/src/boost/filesystem/v2/path.hpp b/3rdParty/Boost/src/boost/filesystem/v2/path.hpp index 16d67ca..615b89c 100644 --- a/3rdParty/Boost/src/boost/filesystem/v2/path.hpp +++ b/3rdParty/Boost/src/boost/filesystem/v2/path.hpp @@ -20,16 +20,15 @@ #include <boost/filesystem/v2/config.hpp> #include <boost/system/system_error.hpp> #include <boost/iterator/iterator_facade.hpp> -#include <boost/throw_exception.hpp> #include <boost/shared_ptr.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/static_assert.hpp> +#include <boost/assert.hpp> #include <string> #include <algorithm> // for lexicographical_compare #include <iosfwd> // needed by basic_path inserter and extractor #include <stdexcept> -#include <cassert> # ifndef BOOST_FILESYSTEM2_NARROW_ONLY # include <locale> @@ -916,7 +915,7 @@ namespace boost boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits> path_type; - assert( !str.empty() && str[pos] == slash<path_type>::value + BOOST_ASSERT( !str.empty() && str[pos] == slash<path_type>::value && "precondition violation" ); // subsequent logic expects pos to be for leftmost slash of a set @@ -1380,7 +1379,7 @@ namespace boost typedef typename Path::string_type string_type; typedef typename Path::traits_type traits_type; - assert( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" ); + BOOST_ASSERT( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" ); bool was_net( itr.m_name.size() > 2 && itr.m_name[0] == slash<Path>::value @@ -1439,7 +1438,7 @@ namespace boost template<class Path> void iterator_helper<Path>::do_decrement( iterator & itr ) { - assert( itr.m_pos && "basic_path::iterator decrement past begin()" ); + BOOST_ASSERT( itr.m_pos && "basic_path::iterator decrement past begin()" ); typedef typename Path::string_type string_type; typedef typename Path::traits_type traits_type; |