diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-07-28 02:12:54 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-07-28 02:12:54 -0700 |
| commit | 8bec6205ae1631dc0896fe25795b2946ed414df0 (patch) | |
| tree | a40734bf042ab2236c65254bed08fac23bccc3e5 /src/common.h | |
| parent | acea02e9b90a83167d15e62741c8e8bb9f0d4b7c (diff) | |
Arenas and start work on strings
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..1add4db --- /dev/null +++ b/src/common.h @@ -0,0 +1,29 @@ +#pragma once + +#include <stdint.h> +#include <stddef.h> + +#define KiB(n) ((u64)n<<10) +#define MiB(n) ((u64)n<<20) +#define GiB(n) ((u64)n<<30) + +#define MAX(n, m) ((n > m) ? (n) : (m)) +#define MIN(n, m) ((n < m) ? (n) : (m)) +#define ALIGN_UP_POW2(n, m) (((u64)(n) + (u64)(m) - 1) & (~((u64)(m) - 1))) + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef i8 b8; +typedef i32 b32; + +typedef float f32; +typedef double f64; + +#define ARENA_ALIGN (sizeof(void*)) |