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

@ -23,8 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 23
template <integral _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
if constexpr (sizeof(_Tp) == 1) {
return __val;
} else if constexpr (sizeof(_Tp) == 2) {
@ -33,15 +32,15 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
return __builtin_bswap32(__val);
} else if constexpr (sizeof(_Tp) == 8) {
return __builtin_bswap64(__val);
#ifndef _LIBCPP_HAS_NO_INT128
# ifndef _LIBCPP_HAS_NO_INT128
} else if constexpr (sizeof(_Tp) == 16) {
#if __has_builtin(__builtin_bswap128)
# if __has_builtin(__builtin_bswap128)
return __builtin_bswap128(__val);
#else
# else
return static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64 |
static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64)));
#endif // __has_builtin(__builtin_bswap128)
#endif // _LIBCPP_HAS_NO_INT128
# endif // __has_builtin(__builtin_bswap128)
# endif // _LIBCPP_HAS_NO_INT128
} else {
static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size");
}