Mjolnir Core
Core functionality of the Mjolnir API
fundamental_types.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 
13 #include <climits>
14 #include <cstddef>
15 #include <cstdint>
16 
17 
18 namespace mjolnir
19 {
20 using I8 = std::int8_t;
21 using I16 = std::int16_t;
22 using I32 = std::int32_t;
23 using I64 = std::int64_t;
24 using IPT = std::intptr_t;
25 using U8 = std::uint8_t;
26 using U16 = std::uint16_t;
27 using U32 = std::uint32_t;
28 using U64 = std::uint64_t;
29 using UST = std::size_t;
30 using UPT = std::uintptr_t;
31 using F32 = float;
32 using F64 = double;
33 
34 
35 constexpr UST float_bit_size = 32;
36 constexpr UST double_bit_size = 64;
37 
38 static_assert(sizeof(float) * CHAR_BIT == float_bit_size, "Incompatible architecture, 'float' size isn't 32 bit");
39 static_assert(sizeof(double) * CHAR_BIT == double_bit_size, "Incompatible architecture, 'double' size isn't 64 bit");
40 
41 } // namespace mjolnir
42 
43 
float F32
32 bit floating point type
Definition: fundamental_types.h:31
constexpr UST double_bit_size
Required size of a double in bits.
Definition: fundamental_types.h:36
constexpr UST float_bit_size
Required size of a float in bits.
Definition: fundamental_types.h:35
std::uintptr_t UPT
Unsigned integer type that has the same size as a pointer.
Definition: fundamental_types.h:30
std::uint32_t U32
32 bit unsigned integer type
Definition: fundamental_types.h:27
std::uint16_t U16
16 bit unsigned integer type
Definition: fundamental_types.h:26
std::uint64_t U64
64 bit unsigned integer type
Definition: fundamental_types.h:28
std::int32_t I32
32 bit signed integer type
Definition: fundamental_types.h:22
std::int16_t I16
16 bit signed integer type
Definition: fundamental_types.h:21
std::size_t UST
Unsigned integer type that is returned by sizeof operations.
Definition: fundamental_types.h:29
std::intptr_t IPT
Signed integer type that has the same size as a pointer.
Definition: fundamental_types.h:24
std::int8_t I8
8 bit signed integer type
Definition: fundamental_types.h:20
double F64
64 bit floating point type
Definition: fundamental_types.h:32
std::uint8_t U8
8 bit unsigned integer type
Definition: fundamental_types.h:25
std::int64_t I64
64 bit signed integer type
Definition: fundamental_types.h:23