From b0236992d263ee4af5999cb42276eae0a7a6b97a Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Thu, 12 Sep 2013 20:47:00 -0700 Subject: [PATCH] style cleanups and an ERRQUIT --- src/common.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/common.h b/src/common.h index 8c9a98e5..d224abfd 100644 --- a/src/common.h +++ b/src/common.h @@ -22,11 +22,11 @@ #ifndef NDEBUG #if defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" #elif defined(__clang__) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Werror=unused-variable" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Werror=unused-variable" #endif static FILE *error_log=0; @@ -41,12 +41,18 @@ static FILE *error_log=0; fprintf(error_log ? error_log : stderr, "\n"); \ } +#define ERRQUIT(...) \ + { \ + ERRLOG(__VA_ARGS__); \ + exit(0); \ + } + #else // NDEBUG #if defined(__GNUC__) - #pragma GCC diagnostic pop +# pragma GCC diagnostic pop #elif defined(__clang__) - #pragma clang diagnostic pop +# pragma clang diagnostic pop #endif #define ERRLOG(...) \