aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/config.h b/src/config.h
index 40a095c..81a2a51 100644
--- a/src/config.h
+++ b/src/config.h
@@ -1,20 +1,26 @@
#pragma once
-typedef char i8;
-typedef unsigned char u8;
+#include <stddef.h>
+#include <stdint.h>
-typedef short i16;
-typedef unsigned short u16;
+typedef int8_t i8;
+typedef uint8_t u8;
-typedef int i32;
-typedef long long i64;
+typedef int16_t i16;
+typedef uint16_t u16;
-typedef unsigned int u32;
-typedef unsigned long long u64;
+typedef int32_t i32;
+typedef int64_t i64;
+
+typedef uint32_t u32;
+typedef uint64_t u64;
typedef float f32;
typedef double f64;
+typedef unsigned char byte;
+typedef ptrdiff_t size;
+
/*
You may be wondering "why fixed point values???", and that's simple
Floating Point was a mistake and has caused great suffering to countless.
@@ -56,4 +62,8 @@ typedef i8 b32;
# endif
#else
# define assert(c)
-#endif \ No newline at end of file
+#endif
+
+#define sizeof(x) (size)sizeof(x)
+#define countof(a) (sizeof(a) / sizeof(*(a)))
+#define lengthof(s) (countof(s) - 1)