diff options
author | pk33 <pk33@pk33.space> | 2024-11-01 23:51:15 +0100 |
---|---|---|
committer | pk33 <pk33@pk33.space> | 2024-11-01 23:51:15 +0100 |
commit | 294b585994da4427ac98a8353ff41aed5f301d54 (patch) | |
tree | aafcd885c1fe28819ef1a511da5e6344411b5597 /include/types.h | |
parent | f0958551b43959174d28b2056f584d2081494e6c (diff) | |
download | engine33-294b585994da4427ac98a8353ff41aed5f301d54.tar.gz |
Import and fix old code
Diffstat (limited to 'include/types.h')
-rw-r--r-- | include/types.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/types.h b/include/types.h new file mode 100644 index 0000000..bd52ac4 --- /dev/null +++ b/include/types.h @@ -0,0 +1,46 @@ +#ifndef __TYPES_H__ +#define __TYPES_H__ + +#include "stdlib.h" +#include "stdint.h" +#include "sys/types.h" + + +#define E33_EXIT_SUCCESS 0 +#define E33_EXIT_FAILURE 1 +#define E33_TRUE 1 +#define E33_FALSE 0 + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef float f32; +typedef double f64; + +typedef uintptr_t uPtr; +typedef ssize_t Size; +typedef size_t uSize; + +typedef const char * String; + +typedef Size err; +typedef Size boolean; + +#define sizeof(x) (Size)sizeof(x) +#define alignof(x) (Size)_Alignof(x) +#define countof(a) (sizeof(a) / sizeof(*(a))) +#define lengthof(s) (countof(s) - 1) + +#define assert(c) while( !(c) ){ __builtin_unreachable(); } + +#define bp(V) logd( "BREAKPOINT :: %d", V ); + + +#endif /* __TYPES_H__ */ |