Minor cleanup

This commit is contained in:
Bruce Hill 2024-02-17 14:54:19 -05:00
parent 58a0b6c6e1
commit 60f3e91b80
2 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,6 @@ int main(int argc, char *argv[])
CORD_appendf(&env->main, "%r\n", code);
}
#define CORD_all(...) CORD_catn(sizeof((CORD[]){__VA_ARGS__})/sizeof(CORD), __VA_ARGS__)
CORD fileinfo = CORD_asprintf("#line 0 \"%s\"\n", f->filename);
CORD program = CORD_all(
fileinfo,

1
util.h
View File

@ -27,6 +27,7 @@ char *heap_str(const char *str);
char *heap_strf(const char *fmt, ...);
CORD CORD_asprintf(CORD fmt, ...);
#define CORD_appendf(cord, fmt, ...) CORD_sprintf(cord, "%r" fmt, *(cord) __VA_OPT__(,) __VA_ARGS__)
#define CORD_all(...) CORD_catn(sizeof((CORD[]){__VA_ARGS__})/sizeof(CORD), __VA_ARGS__)
#define asprintfa(...) ({ char *_buf = alloca(snprintf(0, 0, __VA_ARGS__)); sprintf(_buf, __VA_ARGS__); _buf; })