Bluetooth: Add BT_ASSERT() helper macro
Change-Id: Ib9cfb6494cb3369f4c1e029010589c4d6967afcb Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
df92f7c4c6
commit
5e5c87503d
1 changed files with 4 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue