diff options
author | Markus Teich <teichm@fs.tum.de> | 2016-12-02 10:41:46 +0100 |
---|---|---|
committer | Markus Teich <teichm@fs.tum.de> | 2016-12-02 10:41:46 +0100 |
commit | c7bd34d154729521cf1ea959550957759207dcf2 (patch) | |
tree | bce107a3b9ac3b5e3341f9c88b1c31d282bd33fd /src/include/gnunet_common.h | |
parent | 1583915a015aa6387b7f387df2f43f3d34a6dfb0 (diff) | |
download | gnunet-c7bd34d154729521cf1ea959550957759207dcf2.tar.gz gnunet-c7bd34d154729521cf1ea959550957759207dcf2.zip |
libgnunetutil: add GNUNET_assert_from()
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r-- | src/include/gnunet_common.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 | |||
@@ -654,6 +654,16 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
654 | 654 | ||
655 | /** | 655 | /** |
656 | * @ingroup logging | 656 | * @ingroup logging |
657 | * Use this for fatal errors that cannot be handled | ||
658 | * | ||
659 | * @param cond Condition to evaluate | ||
660 | * @param comp Component string to use for logging | ||
661 | */ | ||
662 | #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) | ||
663 | |||
664 | |||
665 | /** | ||
666 | * @ingroup logging | ||
657 | * Use this for internal assertion violations that are | 667 | * Use this for internal assertion violations that are |
658 | * not fatal (can be handled) but should not occur. | 668 | * not fatal (can be handled) but should not occur. |
659 | */ | 669 | */ |