aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-05 18:47:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-05 18:47:50 +0000
commite1196c2c76e6a4a142a91bb9e0a0fae1a06f68fc (patch)
treea220e450deca24c69178cd0b0b8aeb0c21dd8792 /src/include
parentbf886ddf525b991c6a11c9bd0be10e9aa0dd1c80 (diff)
downloadgnunet-e1196c2c76e6a4a142a91bb9e0a0fae1a06f68fc.tar.gz
gnunet-e1196c2c76e6a4a142a91bb9e0a0fae1a06f68fc.zip
introducing GNUNET_abort
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_common.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 8f3ff8127..69a428bb5 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -245,6 +245,13 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, const char *comp,
245#define GNUNET_log_from(...) 245#define GNUNET_log_from(...)
246#endif 246#endif
247 247
248
249/**
250 * Abort the process, generate a core dump if possible.
251 */
252void
253GNUNET_abort (void);
254
248/** 255/**
249 * Ignore the next n calls to the log function. 256 * Ignore the next n calls to the log function.
250 * 257 *
@@ -351,12 +358,12 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
351/** 358/**
352 * Use this for fatal errors that cannot be handled 359 * Use this for fatal errors that cannot be handled
353 */ 360 */
354#define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); abort(); } } while(0) 361#define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort(); } } while(0)
355 362
356/** 363/**
357 * Use this for fatal errors that cannot be handled 364 * Use this for fatal errors that cannot be handled
358 */ 365 */
359#define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); abort(); } } while(0) 366#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)
360 367
361/** 368/**
362 * Use this for internal assertion violations that are 369 * Use this for internal assertion violations that are