From: Markus Teich Date: Fri, 2 Dec 2016 09:41:46 +0000 (+0100) Subject: libgnunetutil: add GNUNET_assert_from() X-Git-Tag: taler-0.2.1~563 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c7bd34d154729521cf1ea959550957759207dcf2;p=oweals%2Fgnunet.git libgnunetutil: add GNUNET_assert_from() --- diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index dcd0c6056..897502155 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -652,6 +652,16 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); #define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); GNUNET_abort_(); } } while(0) +/** + * @ingroup logging + * Use this for fatal errors that cannot be handled + * + * @param cond Condition to evaluate + * @param comp Component string to use for logging + */ +#define GNUNET_assert_from(cond, comp) do { if (! (cond)) { GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, comp, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0) + + /** * @ingroup logging * Use this for internal assertion violations that are