#include "aoc.h" #include "util.h" #include #include #include void aoc_check(const char *sol, const char *fmtstr, ...) { char buf[256]; va_list ap; va_start(ap, fmtstr); vsnprintf(buf, 256, fmtstr, ap); va_end(ap); if (strcmp(sol, buf)) die("aoc: solution check failed"); } void aoc_debug(const char *fmtstr, ...) { va_list ap; if (!aoc.debug) return; va_start(ap, fmtstr); vfprintf(stderr, fmtstr, ap); va_end(ap); }