Bluetooth: Add BT_ASSERT() helper macro

Change-Id: Ib9cfb6494cb3369f4c1e029010589c4d6967afcb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-07-07 12:07:50 +03:00 committed by Anas Nashif
commit 5e5c87503d

View file

@ -42,11 +42,15 @@
#define BT_ERR(fmt, ...) printf("bt: %s: " fmt, __func__, ##__VA_ARGS__)
#define BT_WARN(fmt, ...) printf("bt: %s: " fmt, __func__, ##__VA_ARGS__)
#define BT_INFO(fmt, ...) printf("bt: " fmt, ##__VA_ARGS__)
#define BT_ASSERT(cond) if (!(cond)) { \
BT_ERR("bt: assert: '" #cond "' failed\n"); \
}
#else
#define BT_DBG(fmt, ...)
#define BT_ERR(fmt, ...)
#define BT_WARN(fmt, ...)
#define BT_INFO(fmt, ...)
#define BT_ASSERT(cond)
#endif /* CONFIG_BLUETOOTH_DEBUG */
#endif /* __BT_LOG_H */