mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
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:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
99
third_party/libcxx/cstddef
vendored
99
third_party/libcxx/cstddef
vendored
|
@ -33,7 +33,6 @@ Types:
|
|||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__config>
|
||||
#include <__type_traits/enable_if.h>
|
||||
#include <__type_traits/integral_constant.h>
|
||||
|
@ -67,77 +66,65 @@ using ::max_align_t _LIBCPP_USING_IF_EXISTS;
|
|||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17
|
||||
namespace std // purposefully not versioned
|
||||
namespace std // purposefully not versioned
|
||||
{
|
||||
enum class byte : unsigned char {};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator| (byte __lhs, byte __rhs) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator|(byte __lhs, byte __rhs) noexcept {
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)));
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = __lhs | __rhs; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator& (byte __lhs, byte __rhs) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept {
|
||||
return __lhs = __lhs | __rhs;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = __lhs & __rhs; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator^ (byte __lhs, byte __rhs) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator&(byte __lhs, byte __rhs) noexcept {
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)));
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = __lhs ^ __rhs; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator~ (byte __b) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
~static_cast<unsigned int>(__b)
|
||||
));
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept {
|
||||
return __lhs = __lhs & __rhs;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
using _EnableByteOverload = __enable_if_t<is_integral<_Tp>::value, byte>;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator^(byte __lhs, byte __rhs) noexcept {
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)));
|
||||
}
|
||||
|
||||
template <class _Integer>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> &
|
||||
operator<<=(byte& __lhs, _Integer __shift) noexcept
|
||||
{ return __lhs = __lhs << __shift; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept {
|
||||
return __lhs = __lhs ^ __rhs;
|
||||
}
|
||||
|
||||
template <class _Integer>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer>
|
||||
operator<< (byte __lhs, _Integer __shift) noexcept
|
||||
{ return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift)); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr byte operator~(byte __b) noexcept {
|
||||
return static_cast<byte>(static_cast<unsigned char>(~static_cast<unsigned int>(__b)));
|
||||
}
|
||||
|
||||
template <class _Integer>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> &
|
||||
operator>>=(byte& __lhs, _Integer __shift) noexcept
|
||||
{ return __lhs = __lhs >> __shift; }
|
||||
template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte& operator<<=(byte& __lhs, _Integer __shift) noexcept {
|
||||
return __lhs = __lhs << __shift;
|
||||
}
|
||||
|
||||
template <class _Integer>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer>
|
||||
operator>> (byte __lhs, _Integer __shift) noexcept
|
||||
{ return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift)); }
|
||||
template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator<<(byte __lhs, _Integer __shift) noexcept {
|
||||
return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift));
|
||||
}
|
||||
|
||||
template <class _Integer, class = _EnableByteOverload<_Integer> >
|
||||
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Integer
|
||||
to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); }
|
||||
template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte& operator>>=(byte& __lhs, _Integer __shift) noexcept {
|
||||
return __lhs = __lhs >> __shift;
|
||||
}
|
||||
|
||||
template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr byte operator>>(byte __lhs, _Integer __shift) noexcept {
|
||||
return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift));
|
||||
}
|
||||
|
||||
template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
|
||||
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Integer to_integer(byte __b) noexcept {
|
||||
return static_cast<_Integer>(__b);
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue