lib: Use g_assert* to implement BUG() and BUG_ON() assertions

This commit is contained in:
Bastien Nocera 2018-05-23 19:14:33 +02:00
parent 32fcfde86b
commit ff09456cf5

View file

@ -44,14 +44,8 @@
#define fp_warn g_warning #define fp_warn g_warning
#define fp_err g_error #define fp_err g_error
#ifndef NDEBUG #define BUG_ON(condition) g_assert(condition)
#define BUG_ON(condition) \ #define BUG() g_assert_not_reached()
if ((condition)) fp_err("BUG at %s:%d", __FILE__, __LINE__)
#else
#define BUG_ON(condition)
#endif
#define BUG() BUG_ON(1)
enum fp_dev_state { enum fp_dev_state {
DEV_STATE_INITIAL = 0, DEV_STATE_INITIAL = 0,