Skip to content

Commit

Permalink
btc_common: Redefine BTC assert macro to use standard assert
Browse files Browse the repository at this point in the history
Allows assert to be disabled, made silent, etc.

Progress towards #6306
  • Loading branch information
projectgus committed Mar 2, 2021
1 parent a0c73c5 commit 0d26c89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/bt/host/bluedroid/btc/core/btc_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static void btc_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
)
#endif
if (1) {
bt_status_t ret;
bt_status_t ret __attribute__((unused));
BTC_TRACE_DEBUG("%s: Storing link key. key_type=0x%x",
__FUNCTION__, p_auth_cmpl->key_type);
ret = btc_storage_add_bonded_device(&bd_addr,
Expand Down
4 changes: 2 additions & 2 deletions components/bt/host/bluedroid/btc/include/btc/btc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#ifndef __BTC_COMMON_H__
#define __BTC_COMMON_H__

#include <assert.h>
#include "common/bt_trace.h"
#include "stack/bt_types.h"
#include "osi/osi.h"

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

#define BTC_HAL_CBACK(P_CB, P_CBACK, ...)\
if (P_CB && P_CB->P_CBACK) { \
Expand Down

0 comments on commit 0d26c89

Please sign in to comment.