mirror of
https://git.stationery.faith/corn/corn.git
synced 2024-09-20 02:21:42 +00:00
11 lines
343 B
C
11 lines
343 B
C
#pragma once
|
|
|
|
#define _PANIC_STR(x) _PANIC_STR2(x)
|
|
#define _PANIC_STR2(x) #x
|
|
|
|
#define panic(...) _panic_impl(_PANIC_STR(__LINE__), __FILE__, __VA_ARGS__)
|
|
#define kassert(val, ...) do { if (!(val)) { panic(__VA_ARGS__); } } while (0)
|
|
|
|
__attribute__((format(printf, 3, 4)))
|
|
_Noreturn void _panic_impl(char *line, char *file, char *format, ...);
|