diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_common.h | 11 |
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 | */ | ||
252 | void | ||
253 | GNUNET_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 |