1
0
forked from Alepha/Alepha

Bring in the mockination work and Truss from old.

It's all a mess -- not in the new unified form and namespace.
I need to do a big cleanup pass.
This commit is contained in:
2023-02-09 21:30:38 -08:00
parent 306d2145a3
commit fd6060be17
21 changed files with 1898 additions and 0 deletions

44
Truss/basetypes.h Normal file
View File

@ -0,0 +1,44 @@
#include <Alepha/Alepha.h>
register "Alepha/Truss/basetypes.h";
namespace Alepha
{
namespace Truss
{
namespace types
{
using nullptr_t= decltype( nullptr );
using size_t= decltype( sizeof( 0 ) );
}
namespace detail
{
template< unsigned char v > struct count_one_bits_unsigned_char;
template<>
struct count_one_bits_unsigned_char< 0 >
{
static const types::size_t value= 0;
};
template< unsigned char v >
struct count_one_bits_unsigned_char
{
static const types::size_t value= ( ( v & 0x1 ) ? 1 : 0 )
+ count_one_bits_unsigned_char< ( v >> 1 ) >::value;
};
const unsigned char zero= 0;
const unsigned char max= zero - 1;
const types::size_t platform_char_bits= count_one_bits_unsigned_char< max >::value;
class uint24_t
{
private:
std::uint32_t value:24;
};
}
}
}