diff options
| author | LLLL Colonq <llll@colonq> | 2025-09-20 23:25:29 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-09-20 23:25:29 -0400 |
| commit | 85a67a25ac9757e694166b3c9e9e2c8cdeefc6da (patch) | |
| tree | a381993c6f0d85aec3c3ead4ed7fa66583338ccb /src/utils.h | |
Initial commit
Diffstat (limited to 'src/utils.h')
| -rw-r--r-- | src/utils.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..9a740e5 --- /dev/null +++ b/src/utils.h @@ -0,0 +1,15 @@ +#ifndef PIT_UTILS_H +#define PIT_UTILS_H + +#include <stdckdint.h> + +void pit_panic_(const char *format, ...); +void pit_debug_(const char *format, ...); +#define PIT_STRSTR(x) #x +#define PIT_STR(x) PIT_STRSTR(x) +#define pit_panic(format, ...) pit_panic_("error [" __FILE__ ":" PIT_STR(__LINE__) "] " format "\n" __VA_OPT__(,) __VA_ARGS__) +#define pit_debug(format, ...) pit_debug_("[" __FILE__ ":" PIT_STR(__LINE__) "] " format "\n" __VA_OPT__(,) __VA_ARGS__) +#define pit_mul(result, a, b) if (ckd_mul(result, a, b)) pit_panic("integer overflow during multiplication"); + + +#endif |
