[fdb] use native assert if FDB_USING_NATIVE_ASSERT is set (#228)

This commit is contained in:
benpicco 2023-08-09 13:55:20 +02:00 committed by GitHub
parent d01c0d48aa
commit a4e68ae965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -62,12 +62,16 @@ extern "C" {
/* routine print function. Must be implement by user. */ /* routine print function. Must be implement by user. */
#define FDB_INFO(...) FDB_LOG_PREFIX();FDB_PRINT(__VA_ARGS__) #define FDB_INFO(...) FDB_LOG_PREFIX();FDB_PRINT(__VA_ARGS__)
/* assert for developer. */ /* assert for developer. */
#ifdef FDB_USING_NATIVE_ASSERT
#define FDB_ASSERT(EXPR) assert(EXPR);
#else
#define FDB_ASSERT(EXPR) \ #define FDB_ASSERT(EXPR) \
if (!(EXPR)) \ if (!(EXPR)) \
{ \ { \
FDB_INFO("(%s) has assert failed at %s.\n", #EXPR, __func__); \ FDB_INFO("(%s) has assert failed at %s.\n", #EXPR, __func__); \
while (1); \ 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_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 */ #define FDB_KVDB_CTRL_GET_SEC_SIZE 0x01 /**< get sector size control command */