diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-16 09:39:32 +0200 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-16 09:39:32 +0200 |
| commit | 2e348c8925ecbd627404a387100b9ad300041ad5 (patch) | |
| tree | d84df5b93c0e0dd5379a217d3c9eccecc6e480ee /omni/int.h | |
init
Diffstat (limited to 'omni/int.h')
| -rw-r--r-- | omni/int.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/omni/int.h b/omni/int.h new file mode 100644 index 0000000..ce27730 --- /dev/null +++ b/omni/int.h @@ -0,0 +1,56 @@ +#ifndef OMNI_INT_H +#define OMNI_INT_H + +#include <stdint.h> + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; + +typedef float f32; +typedef double f64; + +#define U8_MAX UINT8_MAX +#define U16_MAX UINT16_MAX +#define U32_MAX UINT32_MAX +#define U64_MAX UINT64_MAX + +#define I8_MIN INT8_MIN +#define I16_MIN INT16_MIN +#define I32_MIN INT32_MIN +#define I64_MIN INT64_MIN + +#define I8_MAX INT8_MAX +#define I16_MAX INT16_MAX +#define I32_MAX INT32_MAX +#define I64_MAX INT64_MAX + +#if UINTPTR_MAX == UINT64_MAX +typedef u64 usize; +typedef i64 isize; + +#define USIZE_MAX UINT64_MAX + +#define ISIZE_MIN INT64_MIN +#define ISIZE_MAX INT64_MAX + +#elif UINTPTR_MAX == UINT32_MAX +typedef u32 usize; +typedef i32 isize; + +#define USIZE_MAX UINT32_MAX + +#define ISIZE_MIN INT32_MIN +#define ISIZE_MAX INT32_MAX + +#else +#error "target is not supported" +#endif + +#endif |
