diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-01-18 22:16:55 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-18 22:16:55 +0100 |
commit | 6b260962eef4caa486ceee9a60b61c67269025c6 (patch) | |
tree | dacf3dfd87d440f998eab8e486996e12132aef01 /global.c |
Initial
Diffstat (limited to 'global.c')
-rw-r--r-- | global.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/global.c b/global.c new file mode 100644 index 0000000..27f522c --- /dev/null +++ b/global.c @@ -0,0 +1,16 @@ +#define _GNU_SOURCE +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> +#include "global.h" + +__attribute__((noreturn, format (printf, 1, 2))) +void throw(const char *format,...){ + char *buf; + va_list ap; + va_start(ap,format); + vasprintf(&buf,format,ap); + va_end(ap); + fprintf(stderr,"THROW: %s\n",buf); + exit(1); +} |