From 108b41997af2678a048dba3feb8c02005638c266 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 30 Mar 2015 16:57:19 -0400 Subject: [PATCH] Formatted abort_if --- src/util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.h b/src/util.h index ff34696..1a0949d 100644 --- a/src/util.h +++ b/src/util.h @@ -44,6 +44,10 @@ fprintf(stderr, "%20s:%d " msg "\n", __FILE__, __LINE__); \ rval = 1; goto CLEANUP; } +#define abort_iff(cond, msg, ...) if(cond) { \ + fprintf(stderr, "%20s:%d " msg "\n", __FILE__, __LINE__, __VA_ARGS__); \ + rval = 1; goto CLEANUP; } + #define swap(x, y) do \ { unsigned char swap_temp[sizeof(x)]; \ memcpy(swap_temp,&y,sizeof(x)); \