summaryrefslogtreecommitdiff
path: root/lr_types.h
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-11-03 23:25:05 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-11-03 23:25:05 +0100
commit4eb0e6ca3adea9f6139299316b0fac1f1369bd8e (patch)
treebb75b8c92c7027ceebd0486241e29640c0a08059 /lr_types.h
checkpoint
Diffstat (limited to 'lr_types.h')
-rw-r--r--lr_types.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/lr_types.h b/lr_types.h
new file mode 100644
index 0000000..6bb3527
--- /dev/null
+++ b/lr_types.h
@@ -0,0 +1,44 @@
+#ifndef LR_TYPES_H
+#define LR_TYPES_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define internal static
+#define local_persist static
+#define global_variable static
+
+#define Pi32 3.14159265359f
+
+#define Kilobytes(Value) ((Value)*1024LL)
+#define Megabytes(Value) (Kilobytes(Value)*1024LL)
+#define Gigabytes(Value) (Megabytes(Value)*1024LL)
+#define Terabytes(Value) (Gigabytes(Value)*1024LL)
+
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+typedef s32 b32;
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef size_t umm;
+typedef ssize_t smm;
+typedef s32 rune; // utf8 codepoint
+
+typedef float f32;
+typedef double f64;
+
+#define U8Max 0xff
+#define U16Max 0xffff
+#define S32Min ((s32)0x80000000)
+#define S32Max ((s32)0x7fffffff)
+#define U32Min 0
+#define U32Max ((u32)-1)
+#define U64Max ((u64)-1)
+
+#endif //LR_TYPES_H