diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-30 01:19:54 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-30 01:19:54 -0500 |
| commit | 5b87ec6ef2b84f1d319e5376bcf9eedea9829d79 (patch) | |
| tree | f1afa80f034a1cd73192510046978435252e1160 /cup/utils.c | |
| parent | Remove return-0 example (diff) | |
| download | archived-cup-5b87ec6ef2b84f1d319e5376bcf9eedea9829d79.tar.xz archived-cup-5b87ec6ef2b84f1d319e5376bcf9eedea9829d79.zip | |
Rename `cup` directory to `src`
Diffstat (limited to 'cup/utils.c')
| -rw-r--r-- | cup/utils.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/cup/utils.c b/cup/utils.c deleted file mode 100644 index 2335981..0000000 --- a/cup/utils.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "utils.h" - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> - -void die(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - exit(1); -} - -void _die_location(char *file, int line, Location loc, const char *fmt, ...) -{ - Location_print(stderr, loc); - fprintf(stderr, ": "); - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fprintf(stderr, "\n"); - fprintf(stderr, "NOTE: Error occurred in %s:%d\n", file, line); - exit(1); -} - -i64 i64max(i64 a, i64 b) { return a > b ? a : b; } -i64 i64min(i64 a, i64 b) { return a < b ? a : b; }
\ No newline at end of file |