diff options
Diffstat (limited to 'arch/amd64/include/arch_stdint.h')
| -rw-r--r-- | arch/amd64/include/arch_stdint.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/amd64/include/arch_stdint.h b/arch/amd64/include/arch_stdint.h new file mode 100644 index 0000000..06040e2 --- /dev/null +++ b/arch/amd64/include/arch_stdint.h @@ -0,0 +1,29 @@ +#ifndef AMD64_STDINT_H +#define AMD64_STDINT_H + +#include <assert.h> + +typedef unsigned char u8; +typedef char i8; + +typedef unsigned short int u16; +typedef short int i16; +static_assert(sizeof(u16) == 2, "u16 is 2 bytes"); +static_assert(sizeof(i16) == 2, "i16 is 2 bytes"); + +typedef unsigned int u32; +typedef int i32; +static_assert(sizeof(u32) == 4, "u16 is 4 bytes"); +static_assert(sizeof(i32) == 4, "i16 is 4 bytes"); + +typedef unsigned long long int u64; +typedef long long int i64; +static_assert(sizeof(u64) == 8, "u64 is 8 bytes"); +static_assert(sizeof(i64) == 8, "i64 is 8 bytes"); + +typedef unsigned long long int usize; +typedef long long int isize; +static_assert(sizeof(usize) == 8, "usize is 8 bytes"); +static_assert(sizeof(isize) == 8, "isize is 8 bytes"); + +#endif
\ No newline at end of file |
