mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +00:00
Fix std::filesystem
This change makes a second pass, at fixing the errno issue with libcxx's filesystem code. Previously, 89.01% of LLVM's test suite was passing and now 98.59% of their tests pass. Best of all, it's now possible for Clang to be built as a working APE binary that can to compile the Cosmopolitan repository. Please note it has only been vetted so far for some objects, and more work would obviously need to be done in cosmo, to fix warnings.
This commit is contained in:
parent
0d7c272d3f
commit
77d3a07ff2
14 changed files with 408 additions and 69 deletions
9
third_party/libcxx/fs/error.h
vendored
9
third_party/libcxx/fs/error.h
vendored
|
@ -98,16 +98,9 @@ inline errc __win_err_to_errc(int err) {
|
|||
|
||||
#endif // _LIBCPP_WIN32API
|
||||
|
||||
errc __cosmo_err_to_errc(int);
|
||||
int __cosmo_errc_to_err(errc);
|
||||
|
||||
inline error_code capture_errno() {
|
||||
_LIBCPP_ASSERT_INTERNAL(errno != 0, "Expected errno to be non-zero");
|
||||
#ifdef __COSMOPOLITAN__
|
||||
return error_code((int)__cosmo_err_to_errc(errno), generic_category());
|
||||
#else
|
||||
return error_code(errno, generic_category());
|
||||
#endif
|
||||
return error_code((int)__err_to_errc(errno), generic_category());
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue