diff options
| author | Syndamia <kamen@syndamia.com> | 2026-04-21 19:32:40 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-04-21 19:32:40 +0300 |
| commit | 2a0c6b4cfeb5d1725e65e714ce7f324583dfa388 (patch) | |
| tree | 082ff93f570dccaffd9b5d051ca33b92c74a58d2 /Types.h | |
| download | foollib-2a0c6b4cfeb5d1725e65e714ce7f324583dfa388.tar foollib-2a0c6b4cfeb5d1725e65e714ce7f324583dfa388.tar.gz foollib-2a0c6b4cfeb5d1725e65e714ce7f324583dfa388.zip | |
feat!: Initial implementation
Diffstat (limited to 'Types.h')
| -rw-r--r-- | Types.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +#ifndef _TYPES +#define _TYPES + +#include "stdint.h" +#include "stddef.h" + +typedef int_fast8_t i8; +typedef int_fast16_t i16; +typedef int_fast32_t i32; +typedef int_fast64_t i64; +typedef uint_fast8_t u8; +typedef uint_fast16_t u16; +typedef uint_fast32_t u32; +typedef uint_fast64_t u64; +typedef size_t usize; + +typedef enum Result { + R_Ok = 0, + R_Err, + R_Invalid, + R_Uninitialized, + R_OutOfBounds, + R_PRIVATE +} Result; + +#define RETURN_NOTOK(x) { Result r = x; if (R_Ok != r) return r; } + +#define B(x) ((x) * 8) +#define KiB(x) ((x) * 1024) +#define MiB(x) ((x) * 1048576) +#define GiB(x) ((x) * 1073741824) + +#endif /* _TYPES */ |
