Skip to content

Commit 9eeb3a7

Browse files
macro EM_ASSERT_CONFIG_FILE for overriding of EFM_ASSERT
1 parent 991121c commit 9eeb3a7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

platform/emlib/inc/em_assert.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#ifndef EM_ASSERT_H
3232
#define EM_ASSERT_H
3333

34+
#if defined(EM_ASSERT_CONFIG_FILE)
35+
#include EM_ASSERT_CONFIG_FILE
36+
#endif
37+
3438
#ifdef __cplusplus
3539
extern "C" {
3640
#endif
@@ -74,10 +78,19 @@ extern "C" {
7478
/* not the assert expression (nor function name (C99)) */
7579
void assertEFM(const char *file, int line);
7680
/** Default assertion is not operational */
81+
82+
#if !defined(EFM_ASSERT_USER)
83+
7784
#define EFM_ASSERT(expr) ((expr) ? ((void)0) : assertEFM(__FILE__, __LINE__))
7885

7986
#else
8087

88+
#define EFM_ASSERT(expr) EFM_ASSERT_USER(expr)
89+
90+
#endif /* !defined(EFM_ASSERT_USER) */
91+
92+
#else
93+
8194
/** Default assertion is not operational */
8295
#define EFM_ASSERT(expr) ((void)(expr))
8396

0 commit comments

Comments
 (0)