summaryrefslogtreecommitdiffstats
path: root/omni/stdint.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-04-16 10:03:45 +0200
committerFabrice <fabrice@schaub-dev.xyz>2026-04-16 10:03:45 +0200
commitec38da55fdbe561f6f180b959cb59b6f3643817b (patch)
tree8653173ed3d078cd340fa1f123b6ae33f07a65bb /omni/stdint.h
parent2e348c8925ecbd627404a387100b9ad300041ad5 (diff)
fixing naming
Diffstat (limited to 'omni/stdint.h')
-rw-r--r--omni/stdint.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/omni/stdint.h b/omni/stdint.h
new file mode 100644
index 0000000..088b584
--- /dev/null
+++ b/omni/stdint.h
@@ -0,0 +1,58 @@
+#ifndef OMNI_INT_H
+#define OMNI_INT_H
+
+#include <stdint.h>
+
+#include "omni/platform.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 OMNI_ARCH_64BIT
+typedef u64 usize;
+typedef i64 isize;
+
+#define USIZE_MAX UINT64_MAX
+
+#define ISIZE_MIN INT64_MIN
+#define ISIZE_MAX INT64_MAX
+
+#elif OMNI_ARCH_32BIT
+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