From ff09456cf5adaead2d3993a7e1476e56a23ff7bb Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 23 May 2018 19:14:33 +0200
Subject: [PATCH] lib: Use g_assert* to implement BUG() and BUG_ON() assertions

---
 libfprint/fp_internal.h | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h
index 3cf5629..9eb7389 100644
--- a/libfprint/fp_internal.h
+++ b/libfprint/fp_internal.h
@@ -44,14 +44,8 @@
 #define fp_warn g_warning
 #define fp_err g_error
 
-#ifndef NDEBUG
-#define BUG_ON(condition) \
-	if ((condition)) fp_err("BUG at %s:%d", __FILE__, __LINE__)
-#else
-#define BUG_ON(condition)
-#endif
-
-#define BUG() BUG_ON(1)
+#define BUG_ON(condition) g_assert(condition)
+#define BUG() g_assert_not_reached()
 
 enum fp_dev_state {
 	DEV_STATE_INITIAL = 0,