core changes

This commit is contained in:
Krzosa Karol
2025-01-06 21:33:00 +01:00
parent 2e2b3ceafb
commit 1710bc232d
11 changed files with 40 additions and 26 deletions

View File

@@ -64,7 +64,7 @@ typedef double f64;
#define zero_struct(x) memory_zero((x), sizeof(*(x)))
#define DEFER_LOOP(begin, end) for (i32 PASTE(_i_, __LINE__) = (begin, 0); !PASTE(_i_, __LINE__); PASTE(_i_, __LINE__) += (end, 1))
#define defer_block(begin, end) for (i32 PASTE(_i_, __LINE__) = (begin, 0); !PASTE(_i_, __LINE__); PASTE(_i_, __LINE__) += (end, 1))
#define STACK(type, size) struct { type data[size]; i32 len; }
#define STACK_PUSH(stack, ...) (assert((stack).len < lengthof((stack).data)), (stack).data[(stack).len++] = __VA_ARGS__)
#define STACK_POP(stack) (assert((stack).len > 0), (stack).data[--(stack).len])