mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Fix the build
This commit is contained in:
parent
77d3a07ff2
commit
c1a0b017e9
6 changed files with 161 additions and 61 deletions
6
third_party/libcxx/fs/directory_iterator.cpp
vendored
6
third_party/libcxx/fs/directory_iterator.cpp
vendored
|
@ -49,7 +49,7 @@ public:
|
|||
if (__stream_ == INVALID_HANDLE_VALUE) {
|
||||
ec = detail::make_windows_error(GetLastError());
|
||||
const bool ignore_permission_denied = bool(opts & directory_options::skip_permission_denied);
|
||||
if (ignore_permission_denied && ec.value() == static_cast<int>(errc::permission_denied))
|
||||
if (ignore_permission_denied && ec == errc::permission_denied)
|
||||
ec.clear();
|
||||
return;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
if ((__stream_ = ::opendir(root.c_str())) == nullptr) {
|
||||
ec = detail::capture_errno();
|
||||
const bool allow_eacces = bool(opts & directory_options::skip_permission_denied);
|
||||
if (allow_eacces && ec.value() == (int)errc::permission_denied)
|
||||
if (allow_eacces && ec == errc::permission_denied)
|
||||
ec.clear();
|
||||
return;
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ bool recursive_directory_iterator::__try_recursion(error_code* ec) {
|
|||
}
|
||||
if (m_ec) {
|
||||
const bool allow_eacess = bool(__imp_->__options_ & directory_options::skip_permission_denied);
|
||||
if (m_ec.value() == (int)errc::permission_denied && allow_eacess) {
|
||||
if (m_ec == errc::permission_denied && allow_eacess) {
|
||||
if (ec)
|
||||
ec->clear();
|
||||
} else {
|
||||
|
|
2
third_party/libcxx/fs/error.h
vendored
2
third_party/libcxx/fs/error.h
vendored
|
@ -100,7 +100,7 @@ inline errc __win_err_to_errc(int err) {
|
|||
|
||||
inline error_code capture_errno() {
|
||||
_LIBCPP_ASSERT_INTERNAL(errno != 0, "Expected errno to be non-zero");
|
||||
return error_code((int)__err_to_errc(errno), generic_category());
|
||||
return error_code(__errc_to_err((errc)errno), generic_category());
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
|
|
4
third_party/libcxx/fs/file_descriptor.h
vendored
4
third_party/libcxx/fs/file_descriptor.h
vendored
|
@ -194,8 +194,8 @@ inline perms posix_get_perms(const StatT& st) noexcept { return static_cast<perm
|
|||
inline file_status create_file_status(error_code& m_ec, path const& p, const StatT& path_stat, error_code* ec) {
|
||||
if (ec)
|
||||
*ec = m_ec;
|
||||
if (m_ec && (m_ec.value() == (int)errc::no_such_file_or_directory ||
|
||||
m_ec.value() == (int)errc::not_a_directory)) {
|
||||
if (m_ec && (m_ec == errc::no_such_file_or_directory ||
|
||||
m_ec == errc::not_a_directory)) {
|
||||
return file_status(file_type::not_found);
|
||||
} else if (m_ec) {
|
||||
ErrorHandler<void> err("posix_stat", ec, &p);
|
||||
|
|
2
third_party/libcxx/system_error.cpp
vendored
2
third_party/libcxx/system_error.cpp
vendored
|
@ -218,7 +218,7 @@ system_error::~system_error() noexcept {}
|
|||
|
||||
void __throw_system_error(int ev, const char* what_arg) {
|
||||
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
|
||||
std::__throw_system_error(error_code((int)__err_to_errc(ev), system_category()), what_arg);
|
||||
std::__throw_system_error(error_code(__errc_to_err((errc)ev), system_category()), what_arg);
|
||||
#else
|
||||
// The above could also handle the no-exception case, but for size, avoid referencing system_category() unnecessarily.
|
||||
_LIBCPP_VERBOSE_ABORT(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue