diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-08-02 20:41:55 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-08-02 21:03:09 (GMT) |
commit | d5ace22054203c7989691ae8b3fa4e4784d1b57e (patch) | |
tree | 64d400cdb10644967df183d0f202fcbf8160a773 /3rdParty/Boost/src/libs/filesystem | |
parent | 6f26d9aa86f0909af13b23b1a925b8d492e74154 (diff) | |
download | swift-contrib-ks/boost1.47.zip swift-contrib-ks/boost1.47.tar.bz2 |
Add two extra Boost dependencies, upgrade to 1.47.0ks/boost1.47
Diffstat (limited to '3rdParty/Boost/src/libs/filesystem')
3 files changed, 77 insertions, 54 deletions
diff --git a/3rdParty/Boost/src/libs/filesystem/v3/src/filesystem_utf8_codecvt_facet.cpp b/3rdParty/Boost/src/libs/filesystem/v3/src/filesystem_utf8_codecvt_facet.cpp index 1849a1a..ed0b422 100644 --- a/3rdParty/Boost/src/libs/filesystem/v3/src/filesystem_utf8_codecvt_facet.cpp +++ b/3rdParty/Boost/src/libs/filesystem/v3/src/filesystem_utf8_codecvt_facet.cpp @@ -3,6 +3,10 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) +// For HP-UX, request that WCHAR_MAX and WCHAR_MIN be defined as macros, +// not casts. See ticket 5048 +#define _INCLUDE_STDCSOURCE_199901 + #ifndef BOOST_SYSTEM_NO_DEPRECATED # define BOOST_SYSTEM_NO_DEPRECATED #endif diff --git a/3rdParty/Boost/src/libs/filesystem/v3/src/operations.cpp b/3rdParty/Boost/src/libs/filesystem/v3/src/operations.cpp index 2460c1d..1106f22 100644 --- a/3rdParty/Boost/src/libs/filesystem/v3/src/operations.cpp +++ b/3rdParty/Boost/src/libs/filesystem/v3/src/operations.cpp @@ -10,6 +10,25 @@ //--------------------------------------------------------------------------------------// +// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355) +#if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) +#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, +#endif +#if !defined(__PGI) +#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX + // 64-bit systems or on 32-bit systems which don't have files larger + // than can be represented by a traditional POSIX/UNIX off_t type. + // OTOH, defining them should kick in 64-bit off_t's (and thus + // st_size)on 32-bit systems that provide the Large File + // Support (LFS)interface, such as Linux, Solaris, and IRIX. + // The defines are given before any headers are included to + // ensure that they are available to all included headers. + // That is required at least on Solaris, and possibly on other + // systems as well. +#else +#define _FILE_OFFSET_BITS 64 +#endif + #include <boost/config.hpp> #if !defined( BOOST_NO_STD_WSTRING ) // Boost.Filesystem V3 and later requires std::wstring support. @@ -30,30 +49,18 @@ # define _POSIX_PTHREAD_SEMANTICS // Sun readdir_r()needs this #endif -#if !(defined(__HP_aCC) && defined(_ILP32) && \ - !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) -#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, -#endif -#if !defined(__PGI) -#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX - // 64-bit systems or on 32-bit systems which don't have files larger - // than can be represented by a traditional POSIX/UNIX off_t type. - // OTOH, defining them should kick in 64-bit off_t's (and thus - // st_size)on 32-bit systems that provide the Large File - // Support (LFS)interface, such as Linux, Solaris, and IRIX. - // The defines are given before any headers are included to - // ensure that they are available to all included headers. - // That is required at least on Solaris, and possibly on other - // systems as well. -#else -#define _FILE_OFFSET_BITS 64 -#endif - #include <boost/filesystem/v3/operations.hpp> #include <boost/scoped_array.hpp> #include <boost/detail/workaround.hpp> -#include <cstdlib> // for malloc, free -#include <vector> +#include <vector> +#include <cstdlib> // for malloc, free +#include <sys/stat.h> // even on Windows some functions use stat() +#include <cstring> +#include <cstdio> // for remove, rename +#if defined(__QNXNTO__) // see ticket #5355 +# include <stdio.h> +#endif +#include <cerrno> #ifdef BOOST_FILEYSTEM_INCLUDE_IOSTREAM # include <iostream> @@ -178,14 +185,6 @@ typedef struct _REPARSE_DATA_BUFFER { # define BOOST_FILESYSTEM_STATUS_CACHE # endif -#include <sys/stat.h> // even on Windows some functions use stat() -#include <string> -#include <cstring> -#include <cstdio> // for remove, rename -#include <cerrno> -#include <cassert> -// #include <iostream> // for debugging only; comment out when not in use - // POSIX/Windows macros ----------------------------------------------------// // Portions of the POSIX and Windows API's are very similar, except for name, @@ -1923,8 +1922,8 @@ namespace detail void directory_iterator_increment(directory_iterator& it, system::error_code* ec) { - BOOST_ASSERT(it.m_imp.get() && "attempt to increment end iterator"); - BOOST_ASSERT(it.m_imp->handle != 0 && "internal program error"); + BOOST_ASSERT_MSG(it.m_imp.get(), "attempt to increment end iterator"); + BOOST_ASSERT_MSG(it.m_imp->handle != 0, "internal program error"); path::string_type filename; file_status file_stat, symlink_file_stat; diff --git a/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp b/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp index cc30570..c1e5bca 100644 --- a/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp +++ b/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp @@ -84,6 +84,7 @@ namespace const wchar_t* preferred_separator_string = L"\\"; const wchar_t colon = L':'; const wchar_t dot = L'.'; + const wchar_t questionmark = L'?'; const fs::path dot_path(L"."); const fs::path dot_dot_path(L".."); @@ -159,14 +160,14 @@ namespace filesystem3 const std::string path::generic_string(const codecvt_type& cvt) const { path tmp(*this); - tmp.make_preferred(); + std::replace(tmp.m_pathname.begin(), tmp.m_pathname.end(), L'\\', L'/'); return tmp.string(cvt); } const std::wstring path::generic_wstring() const { path tmp(*this); - tmp.make_preferred(); + std::replace(tmp.m_pathname.begin(), tmp.m_pathname.end(), L'\\', L'/'); return tmp.wstring(); } @@ -207,7 +208,7 @@ namespace filesystem3 # ifdef BOOST_WINDOWS_API path & path::make_preferred() { - std::replace(m_pathname.begin(), m_pathname.end(), L'\\', L'/'); + std::replace(m_pathname.begin(), m_pathname.end(), L'/', L'\\'); return *this; } # endif @@ -427,8 +428,8 @@ namespace bool is_non_root_separator(const string_type & str, size_type pos) // pos is position of the separator { - BOOST_ASSERT(!str.empty() && is_separator(str[pos]) - && "precondition violation"); + BOOST_ASSERT_MSG(!str.empty() && is_separator(str[pos]), + "precondition violation"); // subsequent logic expects pos to be for leftmost slash of a set while (pos > 0 && is_separator(str[pos-1])) @@ -490,6 +491,19 @@ namespace && is_separator(path[0]) && is_separator(path[1])) return string_type::npos; +# ifdef BOOST_WINDOWS_API + // case "\\?\" + if (size > 4 + && is_separator(path[0]) + && is_separator(path[1]) + && path[2] == questionmark + && is_separator(path[3])) + { + string_type::size_type pos(path.find_first_of(separators, 4)); + return pos < size ? pos : string_type::npos; + } +# endif + // case "//net {/}" if (size > 3 && is_separator(path[0]) @@ -607,7 +621,8 @@ namespace filesystem3 void path::m_path_iterator_increment(path::iterator & it) { - BOOST_ASSERT(it.m_pos < it.m_path_ptr->m_pathname.size() && "path::basic_iterator increment past end()"); + BOOST_ASSERT_MSG(it.m_pos < it.m_path_ptr->m_pathname.size(), + "path::basic_iterator increment past end()"); // increment to position past current element it.m_pos += it.m_element.m_pathname.size(); @@ -663,7 +678,7 @@ namespace filesystem3 void path::m_path_iterator_decrement(path::iterator & it) { - BOOST_ASSERT(it.m_pos && "path::iterator decrement past begin()"); + BOOST_ASSERT_MSG(it.m_pos, "path::iterator decrement past begin()"); size_type end_pos(it.m_pos); @@ -712,11 +727,6 @@ namespace // locale helpers // //------------------------------------------------------------------------------------// - // std::locale construction can throw (if LC_MESSAGES is wrong, for example), - // so a static at function scope is used to ensure that exceptions can be - // caught. (A previous version was at namespace scope, so initialization - // occurred before main(), preventing exceptions from being caught.) - std::locale default_locale() { # ifdef BOOST_WINDOWS_API @@ -726,32 +736,43 @@ namespace # elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) // "All BSD system functions expect their string parameters to be in UTF-8 encoding - // and nothing else." http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html + // and nothing else." See + // http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html // // "The kernel will reject any filename that is not a valid UTF-8 string, and it will // even be normalized (to Unicode NFD) before stored on disk, at least when using HFS. // The right way to deal with it would be to always convert the filename to UTF-8 - // before trying to open/create a file." http://lists.apple.com/archives/unix-porting/2007/Sep/msg00023.html + // before trying to open/create a file." See + // http://lists.apple.com/archives/unix-porting/2007/Sep/msg00023.html // // "How a file name looks at the API level depends on the API. Current Carbon APIs // handle file names as an array of UTF-16 characters; POSIX ones handle them as an // array of UTF-8, which is why UTF-8 works well in Terminal. How it's stored on disk // depends on the disk format; HFS+ uses UTF-16, but that's not important in most - // cases." http://lists.apple.com/archives/applescript-users/2002/Sep/msg00319.html + // cases." See + // http://lists.apple.com/archives/applescript-users/2002/Sep/msg00319.html // // Many thanks to Peter Dimov for digging out the above references! + std::locale global_loc = std::locale(); std::locale loc(global_loc, new boost::filesystem::detail::utf8_codecvt_facet); return loc; -# else - // ISO C calls this "the locale-specific native environment": +# else // Other POSIX + + // ISO C calls std::locale("") "the locale-specific native environment", and this + // locale is the default for many POSIX-based operating systems such as Linux. + + // std::locale("") construction can throw (if environmental variables LC_MESSAGES or + // or LANG are wrong, for example), so dynamic initialization is used to ensure + // that exceptions can be caught. + return std::locale(""); # endif } - std::locale & path_locale() + std::locale& path_locale() { static std::locale loc(default_locale()); return loc; @@ -768,8 +789,7 @@ namespace boost namespace filesystem3 { - const path::codecvt_type *& - path::wchar_t_codecvt_facet() + const path::codecvt_type *& path::wchar_t_codecvt_facet() { static const std::codecvt<wchar_t, char, std::mbstate_t> * facet( @@ -782,12 +802,12 @@ namespace filesystem3 { std::locale temp(path_locale()); path_locale() = loc; - wchar_t_codecvt_facet() = &std::use_facet - <std::codecvt<wchar_t, char, std::mbstate_t> >(path_locale()); + wchar_t_codecvt_facet() = + &std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(path_locale()); return temp; } } // namespace filesystem3 } // namespace boost -#endif // no wide character support +#endif // has wide character support |