Release Cosmopolitan v3.6.0

This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
Justine Tunney 2024-07-23 03:16:17 -07:00
parent 62ace3623a
commit 5660ec4741
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
1585 changed files with 117353 additions and 271644 deletions

View file

@ -58,18 +58,18 @@ enum class errc
no_child_process, // ECHILD
no_link, // ENOLINK
no_lock_available, // ENOLCK
no_message_available, // ENODATA
no_message_available, // ENODATA // deprecated
no_message, // ENOMSG
no_protocol_option, // ENOPROTOOPT
no_space_on_device, // ENOSPC
no_stream_resources, // ENOSR
no_stream_resources, // ENOSR // deprecated
no_such_device_or_address, // ENXIO
no_such_device, // ENODEV
no_such_file_or_directory, // ENOENT
no_such_process, // ESRCH
not_a_directory, // ENOTDIR
not_a_socket, // ENOTSOCK
not_a_stream, // ENOSTR
not_a_stream, // ENOSTR // deprecated
not_connected, // ENOTCONN
not_enough_memory, // ENOMEM
not_supported, // ENOTSUP
@ -87,7 +87,7 @@ enum class errc
resource_unavailable_try_again, // EAGAIN
result_out_of_range, // ERANGE
state_not_recoverable, // ENOTRECOVERABLE
stream_timeout, // ETIME
stream_timeout, // ETIME // deprecated
text_file_busy, // ETXTBSY
timed_out, // ETIMEDOUT
too_many_files_open_in_system, // ENFILE
@ -107,109 +107,118 @@ enum class errc
# pragma GCC system_header
#endif
// The method of pushing and popping the diagnostics fails for GCC. GCC does
// not recognize the pragma's used to generate deprecated diagnostics for
// macros. So GCC does not need the pushing and popping.
//
// TODO Remove this when the deprecated constants are removed.
//
// Note based on the post-review comments in
// https://github.com/llvm/llvm-project/pull/80542 libc++ no longer deprecates
// the macros. Since C libraries may start to deprecate these POSIX macros the
// deprecation warning avoidance is kept.
#if defined(_LIBCPP_COMPILER_CLANG_BASED)
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_PUSH _LIBCPP_SUPPRESS_DEPRECATED_PUSH
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_POP _LIBCPP_SUPPRESS_DEPRECATED_POP
#else
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_PUSH
# define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_POP
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
// Some error codes are not present on all platforms, so we provide equivalents
// for them:
//enum class errc
_LIBCPP_DECLARE_STRONG_ENUM(errc) // [jart]
{
address_family_not_supported ,//= EAFNOSUPPORT,
address_in_use ,//= EADDRINUSE,
address_not_available ,//= EADDRNOTAVAIL,
already_connected ,//= EISCONN,
argument_list_too_long ,//= E2BIG,
argument_out_of_domain ,//= EDOM,
bad_address ,//= EFAULT,
bad_file_descriptor ,//= EBADF,
bad_message ,//= EBADMSG,
broken_pipe ,//= EPIPE,
connection_aborted ,//= ECONNABORTED,
connection_already_in_progress ,//= EALREADY,
connection_refused ,//= ECONNREFUSED,
connection_reset ,//= ECONNRESET,
cross_device_link ,//= EXDEV,
destination_address_required ,//= EDESTADDRREQ,
device_or_resource_busy ,//= EBUSY,
directory_not_empty ,//= ENOTEMPTY,
executable_format_error ,//= ENOEXEC,
file_exists ,//= EEXIST,
file_too_large ,//= EFBIG,
filename_too_long ,//= ENAMETOOLONG,
function_not_supported ,//= ENOSYS,
host_unreachable ,//= EHOSTUNREACH,
identifier_removed ,//= EIDRM,
illegal_byte_sequence ,//= EILSEQ,
inappropriate_io_control_operation ,//= ENOTTY,
interrupted ,//= EINTR,
invalid_argument ,//= EINVAL,
invalid_seek ,//= ESPIPE,
io_error ,//= EIO,
is_a_directory ,//= EISDIR,
message_size ,//= EMSGSIZE,
network_down ,//= ENETDOWN,
network_reset ,//= ENETRESET,
network_unreachable ,//= ENETUNREACH,
no_buffer_space ,//= ENOBUFS,
no_child_process ,//= ECHILD,
no_link ,//= ENOLINK,
no_lock_available ,//= ENOLCK,
#ifdef ENODATA
no_message_available ,//= ENODATA,
#else
no_message_available ,//= ENOMSG,
#endif
no_message ,//= ENOMSG,
no_protocol_option ,//= ENOPROTOOPT,
no_space_on_device ,//= ENOSPC,
#ifdef ENOSR
no_stream_resources ,//= ENOSR,
#else
no_stream_resources ,//= ENOMEM,
#endif
no_such_device_or_address ,//= ENXIO,
no_such_device ,//= ENODEV,
no_such_file_or_directory ,//= ENOENT,
no_such_process ,//= ESRCH,
not_a_directory ,//= ENOTDIR,
not_a_socket ,//= ENOTSOCK,
#ifdef ENOSTR
not_a_stream ,//= ENOSTR,
#else
not_a_stream ,//= EINVAL,
#endif
not_connected ,//= ENOTCONN,
not_enough_memory ,//= ENOMEM,
not_supported ,//= ENOTSUP,
operation_canceled ,//= ECANCELED,
operation_in_progress ,//= EINPROGRESS,
operation_not_permitted ,//= EPERM,
operation_not_supported ,//= EOPNOTSUPP,
operation_would_block ,//= EWOULDBLOCK,
owner_dead ,//= EOWNERDEAD,
permission_denied ,//= EACCES,
protocol_error ,//= EPROTO,
protocol_not_supported ,//= EPROTONOSUPPORT,
read_only_file_system ,//= EROFS,
resource_deadlock_would_occur ,//= EDEADLK,
resource_unavailable_try_again ,//= EAGAIN,
result_out_of_range ,//= ERANGE,
state_not_recoverable ,//= ENOTRECOVERABLE,
#ifdef ETIME
stream_timeout ,//= ETIME,
#else
stream_timeout ,//= ETIMEDOUT,
#endif
text_file_busy ,//= ETXTBSY,
timed_out ,//= ETIMEDOUT,
too_many_files_open_in_system ,//= ENFILE,
too_many_files_open ,//= EMFILE,
too_many_links ,//= EMLINK,
too_many_symbolic_link_levels ,//= ELOOP,
value_too_large ,//= EOVERFLOW,
wrong_protocol_type ,//= EPROTOTYPE
};
// enum class errc
//
// LWG3869 deprecates the UNIX STREAMS macros and enum values.
// This makes the code clumbersome:
// - the enum value is deprecated and should show a diagnostic,
// - the macro is deprecated and should _not_ show a diagnostic in this
// context, and
// - the macro is not always available.
// This leads to the odd pushing and popping of the deprecated
// diagnostic.
_LIBCPP_DECLARE_STRONG_ENUM(errc){
address_family_not_supported, // = EAFNOSUPPORT,
address_in_use, // = EADDRINUSE,
address_not_available, // = EADDRNOTAVAIL,
already_connected, // = EISCONN,
argument_list_too_long, // = E2BIG,
argument_out_of_domain, // = EDOM,
bad_address, // = EFAULT,
bad_file_descriptor, // = EBADF,
bad_message, // = EBADMSG,
broken_pipe, // = EPIPE,
connection_aborted, // = ECONNABORTED,
connection_already_in_progress, // = EALREADY,
connection_refused, // = ECONNREFUSED,
connection_reset, // = ECONNRESET,
cross_device_link, // = EXDEV,
destination_address_required, // = EDESTADDRREQ,
device_or_resource_busy, // = EBUSY,
directory_not_empty, // = ENOTEMPTY,
executable_format_error, // = ENOEXEC,
file_exists, // = EEXIST,
file_too_large, // = EFBIG,
filename_too_long, // = ENAMETOOLONG,
function_not_supported, // = ENOSYS,
host_unreachable, // = EHOSTUNREACH,
identifier_removed, // = EIDRM,
illegal_byte_sequence, // = EILSEQ,
inappropriate_io_control_operation, // = ENOTTY,
interrupted, // = EINTR,
invalid_argument, // = EINVAL,
invalid_seek, // = ESPIPE,
io_error, // = EIO,
is_a_directory, // = EISDIR,
message_size, // = EMSGSIZE,
network_down, // = ENETDOWN,
network_reset, // = ENETRESET,
network_unreachable, // = ENETUNREACH,
no_buffer_space, // = ENOBUFS,
no_child_process, // = ECHILD,
no_link, // = ENOLINK,
no_lock_available, // = ENOLCK,
no_message_available,
no_message, // = ENOMSG,
no_protocol_option, // = ENOPROTOOPT,
no_space_on_device, // = ENOSPC,
no_stream_resources,
no_such_device_or_address, // = ENXIO,
no_such_device, // = ENODEV,
no_such_file_or_directory, // = ENOENT,
no_such_process, // = ESRCH,
not_a_directory, // = ENOTDIR,
not_a_socket, // = ENOTSOCK,
not_a_stream,
not_connected, // = ENOTCONN,
not_enough_memory, // = ENOMEM,
not_supported, // = ENOTSUP,
operation_canceled, // = ECANCELED,
operation_in_progress, // = EINPROGRESS,
operation_not_permitted, // = EPERM,
operation_not_supported, // = EOPNOTSUPP,
operation_would_block, // = EWOULDBLOCK,
owner_dead, // = EOWNERDEAD,
permission_denied, // = EACCES,
protocol_error, // = EPROTO,
protocol_not_supported, // = EPROTONOSUPPORT,
read_only_file_system, // = EROFS,
resource_deadlock_would_occur, // = EDEADLK,
resource_unavailable_try_again, // = EAGAIN,
result_out_of_range, // = ERANGE,
state_not_recoverable, // = ENOTRECOVERABLE,
stream_timeout,
text_file_busy, // = ETXTBSY,
timed_out, // = ETIMEDOUT,
too_many_files_open_in_system, // = ENFILE,
too_many_files_open, // = EMFILE,
too_many_links, // = EMLINK,
too_many_symbolic_link_levels, // = ELOOP,
value_too_large, // = EOVERFLOW,
wrong_protocol_type};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
_LIBCPP_END_NAMESPACE_STD

View file

@ -20,12 +20,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS error_condition;
class _LIBCPP_TYPE_VIS error_code;
class _LIBCPP_EXPORTED_FROM_ABI error_condition;
class _LIBCPP_EXPORTED_FROM_ABI error_code;
class _LIBCPP_HIDDEN __do_message;
class _LIBCPP_TYPE_VIS error_category {
class _LIBCPP_EXPORTED_FROM_ABI error_category {
public:
virtual ~error_category() _NOEXCEPT;
@ -67,8 +67,8 @@ public:
string message(int __ev) const override;
};
_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
_LIBCPP_FUNC_VIS const error_category& system_category() _NOEXCEPT;
__attribute__((__const__)) _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
__attribute__((__const__)) _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
_LIBCPP_END_NAMESPACE_STD

View file

@ -40,7 +40,7 @@ namespace __adl_only {
void make_error_code() = delete;
} // namespace __adl_only
class _LIBCPP_TYPE_VIS error_code {
class _LIBCPP_EXPORTED_FROM_ABI error_code {
int __val_;
const error_category* __cat_;
@ -49,9 +49,8 @@ public:
_LIBCPP_HIDE_FROM_ABI error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {}
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI
error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI error_code(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_code;
*this = make_error_code(__e);
}
@ -61,9 +60,8 @@ public:
__cat_ = &__cat;
}
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
operator=(_Ep __e) _NOEXCEPT {
template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI error_code& operator=(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_code;
*this = make_error_code(__e);
return *this;

View file

@ -12,6 +12,7 @@
#include <__compare/ordering.h>
#include <__config>
#include <__functional/hash.h>
#include <__functional/unary_function.h>
#include <__system_error/errc.h>
#include <__system_error/error_category.h>
@ -46,7 +47,7 @@ namespace __adl_only {
void make_error_condition() = delete;
} // namespace __adl_only
class _LIBCPP_TYPE_VIS error_condition {
class _LIBCPP_EXPORTED_FROM_ABI error_condition {
int __val_;
const error_category* __cat_;
@ -57,9 +58,8 @@ public:
: __val_(__val),
__cat_(&__cat) {}
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI
error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI error_condition(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_condition;
*this = make_error_condition(__e);
}
@ -69,9 +69,8 @@ public:
__cat_ = &__cat;
}
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
operator=(_Ep __e) _NOEXCEPT {
template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI error_condition& operator=(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_condition;
*this = make_error_condition(__e);
return *this;

View file

@ -13,6 +13,7 @@
#include <__config>
#include <__system_error/error_category.h>
#include <__system_error/error_code.h>
#include <__verbose_abort>
#include <stdexcept>
#include <string>
@ -22,7 +23,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS system_error : public runtime_error {
class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {
error_code __ec_;
public:
@ -36,12 +37,17 @@ public:
~system_error() _NOEXCEPT override;
_LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
private:
static string __init(const error_code&, string);
};
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_system_error(int __ev, const char* __what_arg);
_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);
_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __throw_system_error(error_code __ec, const char* __what_arg) {
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw system_error(__ec, __what_arg);
#else
_LIBCPP_VERBOSE_ABORT(
"system_error was thrown in -fno-exceptions mode with error %i and message \"%s\"", __ec.value(), __what_arg);
#endif
}
_LIBCPP_END_NAMESPACE_STD