From a4e68ae965a675b4ad2d9d056601d6e1c092e47f Mon Sep 17 00:00:00 2001 From: benpicco Date: Wed, 9 Aug 2023 13:55:20 +0200 Subject: [PATCH] [fdb] use native assert if FDB_USING_NATIVE_ASSERT is set (#228) --- inc/fdb_def.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/fdb_def.h b/inc/fdb_def.h index 4f60812..f009271 100644 --- a/inc/fdb_def.h +++ b/inc/fdb_def.h @@ -62,12 +62,16 @@ extern "C" { /* routine print function. Must be implement by user. */ #define FDB_INFO(...) FDB_LOG_PREFIX();FDB_PRINT(__VA_ARGS__) /* assert for developer. */ +#ifdef FDB_USING_NATIVE_ASSERT +#define FDB_ASSERT(EXPR) assert(EXPR); +#else #define FDB_ASSERT(EXPR) \ if (!(EXPR)) \ { \ FDB_INFO("(%s) has assert failed at %s.\n", #EXPR, __func__); \ while (1); \ } +#endif #define FDB_KVDB_CTRL_SET_SEC_SIZE 0x00 /**< set sector size control command, this change MUST before database initialization */ #define FDB_KVDB_CTRL_GET_SEC_SIZE 0x01 /**< get sector size control command */