Macros | |
#define | MBED_ASSERT(expr) |
MBED_ASSERT Declare runtime assertions: results in runtime error if condition is false. More... | |
#define | MBED_STATIC_ASSERT(expr, msg) enum {MBED_CONCAT(MBED_ASSERTION_AT_, __LINE__) = sizeof(char[(expr) ? 1 : -1])} |
MBED_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false. More... | |
#define | MBED_STRUCT_STATIC_ASSERT(expr, msg) bool : (expr) ? 0 : -1 |
MBED_STRUCT_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false. More... | |
Functions | |
void | mbed_assert_internal (const char *expr, const char *file, int line) |
Internal mbed assert function which is invoked when MBED_ASSERT macro fails. More... | |
#define MBED_ASSERT | ( | expr | ) |
MBED_ASSERT Declare runtime assertions: results in runtime error if condition is false.
Definition at line 65 of file mbed_assert.h.
#define MBED_STATIC_ASSERT | ( | expr, | |
msg | |||
) | enum {MBED_CONCAT(MBED_ASSERTION_AT_, __LINE__) = sizeof(char[(expr) ? 1 : -1])} |
MBED_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false.
The assertion acts as a declaration that can be placed at file scope, in a code block (except after a label), or as a member of a C++ class/struct/union.
Definition at line 110 of file mbed_assert.h.
#define MBED_STRUCT_STATIC_ASSERT | ( | expr, | |
msg | |||
) | bool : (expr) ? 0 : -1 |
MBED_STRUCT_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false.
Unlike MBED_STATIC_ASSERT, MBED_STRUCT_STATIC_ASSERT can and must be used as a member of a C/C++ class/struct/union.
Definition at line 133 of file mbed_assert.h.
void mbed_assert_internal | ( | const char * | expr, |
const char * | file, | ||
int | line | ||
) |
Internal mbed assert function which is invoked when MBED_ASSERT macro fails.
This function is active only if NDEBUG is not defined prior to including this assert header file. In case of MBED_ASSERT failing condition, error() is called with the assertation message.
expr | Expression to be checked. |
file | File where assertation failed. |
line | Failing assertation line number. |