This commit is contained in:
Krzosa Karol
2025-01-11 08:32:13 +01:00
parent 26d8c176a0
commit e2d87d3631
4 changed files with 21 additions and 15 deletions

View File

@@ -64,6 +64,8 @@ typedef double f64;
#define zero_struct(x) memory_zero((x), sizeof(*(x)))
#define defer_if(begin, cond_end) for (b32 PASTE(_i_, __LINE__) = !!begin; PASTE(_i_, __LINE__); PASTE(_i_, __LINE__) = (cond_end, 0))
#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__)