lib: Use g_assert* to implement BUG() and BUG_ON() assertions
This commit is contained in:
parent
32fcfde86b
commit
ff09456cf5
1 changed files with 2 additions and 8 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue