From e58c29e15da9dcb8b6803b5baaa7a2d306c814f4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 17 Apr 2016 16:49:24 -0400 Subject: [PATCH] Define pointer integer types --- src/kstd/Types.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/kstd/Types.hh b/src/kstd/Types.hh index 28865e8..87670b5 100644 --- a/src/kstd/Types.hh +++ b/src/kstd/Types.hh @@ -13,6 +13,8 @@ extern "C" { #endif +#include + typedef __UINT8_TYPE__ u8; typedef __INT8_TYPE__ i8; typedef __UINT16_TYPE__ u16; @@ -21,9 +23,16 @@ typedef __UINT32_TYPE__ u32; typedef __INT32_TYPE__ i32; typedef __UINT64_TYPE__ u64; typedef __INT64_TYPE__ i64; - typedef __SIZE_TYPE__ usize; +#if __WORDSIZE == 64 +typedef i64 iptr; +typedef u64 uptr; +#else +typedef i32 iptr; +typedef u32 uptr; +#endif + #ifdef __cplusplus } #endif