style cleanups and an ERRQUIT

This commit is contained in:
Aaron Culliney 2013-09-12 20:47:00 -07:00
parent 1f9a1778b9
commit b0236992d2

View File

@ -22,11 +22,11 @@
#ifndef NDEBUG #ifndef NDEBUG
#if defined(__GNUC__) #if defined(__GNUC__)
#pragma GCC diagnostic push # pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Wunused-variable"
#elif defined(__clang__) #elif defined(__clang__)
#pragma clang diagnostic push # pragma clang diagnostic push
#pragma clang diagnostic ignored "-Werror=unused-variable" # pragma clang diagnostic ignored "-Werror=unused-variable"
#endif #endif
static FILE *error_log=0; static FILE *error_log=0;
@ -41,12 +41,18 @@ static FILE *error_log=0;
fprintf(error_log ? error_log : stderr, "\n"); \ fprintf(error_log ? error_log : stderr, "\n"); \
} }
#define ERRQUIT(...) \
{ \
ERRLOG(__VA_ARGS__); \
exit(0); \
}
#else // NDEBUG #else // NDEBUG
#if defined(__GNUC__) #if defined(__GNUC__)
#pragma GCC diagnostic pop # pragma GCC diagnostic pop
#elif defined(__clang__) #elif defined(__clang__)
#pragma clang diagnostic pop # pragma clang diagnostic pop
#endif #endif
#define ERRLOG(...) \ #define ERRLOG(...) \