diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/src/filesystem/error.h')
-rw-r--r-- | contrib/llvm-project/libcxx/src/filesystem/error.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/contrib/llvm-project/libcxx/src/filesystem/error.h b/contrib/llvm-project/libcxx/src/filesystem/error.h index 93da75876151..b86f4ed41071 100644 --- a/contrib/llvm-project/libcxx/src/filesystem/error.h +++ b/contrib/llvm-project/libcxx/src/filesystem/error.h @@ -23,9 +23,9 @@ #include "format_string.h" #if defined(_LIBCPP_WIN32API) -# define WIN32_LEAN_AND_MEAN -# define NOMINMAX -# include <windows.h> // ERROR_* macros +# define WIN32_LEAN_AND_MEAN +# define NOMINMAX +# include <windows.h> // ERROR_* macros #endif _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM @@ -90,7 +90,7 @@ inline errc __win_err_to_errc(int err) { {ERROR_WRITE_PROTECT, errc::permission_denied}, }; - for (const auto &pair : win_error_mapping) + for (const auto& pair : win_error_mapping) if (pair.win == static_cast<DWORD>(err)) return pair.errc; return errc::invalid_argument; @@ -104,9 +104,7 @@ inline error_code capture_errno() { } #if defined(_LIBCPP_WIN32API) -inline error_code make_windows_error(int err) { - return make_error_code(__win_err_to_errc(err)); -} +inline error_code make_windows_error(int err) { return make_error_code(__win_err_to_errc(err)); } #endif template <class T> @@ -143,8 +141,7 @@ struct ErrorHandler { const path* p1_ = nullptr; const path* p2_ = nullptr; - ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr, - const path* p2 = nullptr) + ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr, const path* p2 = nullptr) : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) { if (ec_) ec_->clear(); @@ -173,8 +170,7 @@ struct ErrorHandler { *ec_ = ec; return; } - string what = - string("in ") + func_name_ + ": " + detail::vformat_string(msg, ap); + string what = string("in ") + func_name_ + ": " + detail::vformat_string(msg, ap); switch (bool(p1_) + bool(p2_)) { case 0: __throw_filesystem_error(what, ec); @@ -204,9 +200,7 @@ struct ErrorHandler { return error_value<T>(); } - T report(errc const& err) const { - return report(make_error_code(err)); - } + T report(errc const& err) const { return report(make_error_code(err)); } _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) T report(errc const& err, const char* msg, ...) const { @@ -227,7 +221,7 @@ struct ErrorHandler { } private: - ErrorHandler(ErrorHandler const&) = delete; + ErrorHandler(ErrorHandler const&) = delete; ErrorHandler& operator=(ErrorHandler const&) = delete; }; |