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
/* Functions. */
void msg (int class, const char *format, ...)
- __attribute__ ((format (printf, 2, 3)));
+ PRINTF_FORMAT (2, 3);
void tmsg (int class, const char *title, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
+ PRINTF_FORMAT (3, 4);
void err_failure (void);
void err_cond_fail (void);
/* Obscure functions. */
void err_break (void);
void err_check_count (void);
-void err_hcf (int exit_code) __attribute__ ((noreturn));
+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 */