Add a libcxx with a new operator

This commit is contained in:
Drew Galbraith 2023-06-07 10:48:03 -07:00
parent dcc05f2741
commit 010e261dc7
8 changed files with 132 additions and 2 deletions

View file

@ -0,0 +1,34 @@
/* vim: syntax=cpp */
#pragma once
#include "cstdint"
namespace std {
using ptrdiff_t = uint64_t;
using size_t = uint64_t;
// FIXME: I don't understand what this does.
using max_align_t = uint64_t;
using nullptr_t = decltype(nullptr);
enum class byte : unsigned char {};
// byte type operations
template<class IntType>
constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
template<class IntType>
constexpr byte operator<<(byte b, IntType shift) noexcept;
template<class IntType>
constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
template<class IntType>
constexpr byte operator>>(byte b, IntType shift) noexcept;
constexpr byte& operator|=(byte& l, byte r) noexcept;
constexpr byte operator|(byte l, byte r) noexcept;
constexpr byte& operator&=(byte& l, byte r) noexcept;
constexpr byte operator&(byte l, byte r) noexcept;
constexpr byte& operator^=(byte& l, byte r) noexcept;
constexpr byte operator^(byte l, byte r) noexcept;
constexpr byte operator~(byte b) noexcept;
template<class IntType>
constexpr IntType to_integer(byte b) noexcept;
}