Skip to content

Commit 0d26c89

Browse files
committed
btc_common: Redefine BTC assert macro to use standard assert
Allows assert to be disabled, made silent, etc. Progress towards #6306
1 parent a0c73c5 commit 0d26c89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

components/bt/host/bluedroid/btc/core/btc_dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static void btc_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
342342
)
343343
#endif
344344
if (1) {
345-
bt_status_t ret;
345+
bt_status_t ret __attribute__((unused));
346346
BTC_TRACE_DEBUG("%s: Storing link key. key_type=0x%x",
347347
__FUNCTION__, p_auth_cmpl->key_type);
348348
ret = btc_storage_add_bonded_device(&bd_addr,

components/bt/host/bluedroid/btc/include/btc/btc_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#ifndef __BTC_COMMON_H__
1717
#define __BTC_COMMON_H__
1818

19+
#include <assert.h>
1920
#include "common/bt_trace.h"
2021
#include "stack/bt_types.h"
2122
#include "osi/osi.h"
2223

23-
#define BTC_ASSERTC(cond, msg, val) if (!(cond)) { LOG_ERROR( \
24-
"### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
24+
#define BTC_ASSERTC(cond, msg, val) assert(cond && msg)
2525

2626
#define BTC_HAL_CBACK(P_CB, P_CBACK, ...)\
2727
if (P_CB && P_CB->P_CBACK) { \

0 commit comments

Comments
 (0)