mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +00:00
Add special errno handling to libcxx
This commit is contained in:
parent
0f486a13c8
commit
2c4b88753b
10 changed files with 235 additions and 7 deletions
7
third_party/libcxx/fs/error.h
vendored
7
third_party/libcxx/fs/error.h
vendored
|
@ -98,9 +98,16 @@ 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
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue