Skip to content

Commit d01c0d4

Browse files
authored
[port/fal] add option to use native assert() (#225)
1 parent 07dcd7f commit d01c0d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

port/fal/inc/fal_def.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
#include <stdint.h>
1515
#include <stdio.h>
16+
#ifdef FDB_USING_NATIVE_ASSERT
17+
#include <assert.h>
18+
#endif
1619

1720
#define FAL_SW_VERSION "0.5.99"
1821

@@ -50,6 +53,7 @@
5053
#endif
5154

5255
#if FAL_DEBUG
56+
#ifndef FDB_USING_NATIVE_ASSERT
5357
#ifdef assert
5458
#undef assert
5559
#endif
@@ -59,6 +63,7 @@ if (!(EXPR)) \
5963
FAL_PRINTF("(%s) has assert failed at %s.\n", #EXPR, __func__ ); \
6064
while (1); \
6165
}
66+
#endif
6267

6368
/* debug level log */
6469
#ifdef log_d
@@ -69,10 +74,12 @@ if (!(EXPR)) \
6974

7075
#else
7176

77+
#ifndef FDB_USING_NATIVE_ASSERT
7278
#ifdef assert
7379
#undef assert
7480
#endif
7581
#define assert(EXPR) ((void)0);
82+
#endif
7683

7784
/* debug level log */
7885
#ifdef log_d

0 commit comments

Comments
 (0)