Add bt_common_abort() and use it instead of abort() directly
[babeltrace.git] / src / lib / assert-pre.h
index 39472a44cba9478967b9afdb0c03901b7b8ea426..03d86de368fd8d5d4f61a15eba644525029fee5f 100644 (file)
 # error Include "lib/logging.h" before this header.
 #endif
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <inttypes.h>
+#include "common/common.h"
 #include "common/macros.h"
 
 /*
@@ -86,7 +88,7 @@
  * code), use BT_ASSERT_POST().
  *
  * To assert that an internal postcondition is satisfied, use
- * BT_ASSERT().
+ * BT_ASSERT() or BT_ASSERT_DBG().
  */
 #define BT_ASSERT_PRE(_cond, _fmt, ...)                                \
        do {                                                            \
@@ -94,7 +96,7 @@
                        BT_ASSERT_PRE_MSG("Babeltrace 2 library precondition not satisfied; error is:"); \
                        BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__); \
                        BT_ASSERT_PRE_MSG("Aborting...");               \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
        } while (0)
 
This page took 0.023997 seconds and 4 git commands to generate.