Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions platform/emlib/inc/em_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#ifndef EM_ASSERT_H
#define EM_ASSERT_H

#if defined(EM_ASSERT_CONFIG_FILE)
#include EM_ASSERT_CONFIG_FILE
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -74,10 +78,19 @@ extern "C" {
/* not the assert expression (nor function name (C99)) */
void assertEFM(const char *file, int line);
/** Default assertion is not operational */

#if !defined(EFM_ASSERT_USER)

#define EFM_ASSERT(expr) ((expr) ? ((void)0) : assertEFM(__FILE__, __LINE__))

#else

#define EFM_ASSERT(expr) EFM_ASSERT_USER(expr)

#endif /* !defined(EFM_ASSERT_USER) */

#else

/** Default assertion is not operational */
#define EFM_ASSERT(expr) ((void)(expr))

Expand Down