X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ferror.h;h=801ceda310541bfdb733177b938ae4abd9aa4d01;hb=f98e66bead58bd287261d7bc14dab07515498f55;hp=60bcbe85df5cef10bbda9f2c3f4fd615d4a0a85c;hpb=7b98b3a4f58f6dc5a8e9cbc188b627966d5e652d;p=pspp-builds.git diff --git a/src/error.h b/src/error.h index 60bcbe85..801ceda3 100644 --- a/src/error.h +++ b/src/error.h @@ -33,7 +33,7 @@ enum ERR_CLASS_COUNT, /* Number of message classes. */ ERR_CLASS_MASK = 0xf, /* Bitmask for class. */ ERR_VERBOSITY_SHIFT = 4, /* Shift count for verbosity. */ - ERR_VERBOSITY_MASK = 0xf, /* Bitmask for verbosity. */ + ERR_VERBOSITY_MASK = 0xf /* Bitmask for verbosity. */ }; /* If passed to msg() as CLASS, the return value will cause the message @@ -87,4 +87,18 @@ void err_check_count (void); void err_hcf (int exit_code) NO_RETURN; void err_vmsg (const struct error *); +/* Used in panic situations only */ +void request_bug_report_and_abort(const char *msg ); + +void err_assert_fail(const char *expr, const char *file, int line); + +#undef __STRING +#define __STRING(x) #x +#undef assert + + +#define assert(expr) ( (void) ( expr ? (void) 0 : \ + err_assert_fail(__STRING(expr), __FILE__, __LINE__)) ) + + #endif /* error.h */