
Macros | |
| #define | ZB_INLINE_ASSERT(expr) ZB_INLINE_ASSERT_SIMPLE((expr)), |
| Assert which can be used inside an expression. More... | |
| #define | ZB_ASSERT_COMPILE_TIME(expr) ((void)(zb_int_t (*)[(expr) ? 1 : -1])0) |
| Checks condition at compile time in the code (not declaration block). More... | |
| #define | ZB_ASSERT_COMPILE_TIME_EXPR(expr) ((zb_int_t)((zb_int_t (*)[(expr) ? 1 : -1])0)) |
| Checks condition at compile time in the code (not declaration block), returns 0. More... | |
| #define | ZB_ASSERT_COMPILE_DECL(expr) typedef zb_int_t ZB_ASSERT_CAT(assert, __LINE__)[(expr) ? 1 : -1] |
| Checks condition at compile time in the declaration block. More... | |
| #define | ZB_ASSERT_TYPE_SIZE_NOT_GREATER(type, limit) ZB_ASSERT_COMPILE_DECL(sizeof(type) <= (limit)) |
| Ensures, that size of type 'type' is not greater than 'limit'. More... | |
| #define | ZB_ASSERT_TYPE_SIZE_NOT_LESS(type, limit) ZB_ASSERT_COMPILE_DECL(sizeof(type) >= (limit)) |
| Ensures, that size of type 'type' is not less than 'limit'. More... | |
| #define | ZB_ASSERT_TYPE_SIZE_EQ(type, limit) ZB_ASSERT_COMPILE_DECL(sizeof(type) == (limit)) |
| Ensures, that size of type 'type' is equal to the 'limit'. More... | |
Functions | |
| void | zb_abort (char *caller_file, int caller_line) |
| Traces current location, aborts current program execution - with core dump if possible. More... | |
| void | zb_assert (zb_char_t *file_name, zb_int_t line_number) |
| Asserts printing diagnostic and forcing a core dump. More... | |
| #define ZB_INLINE_ASSERT | ( | expr | ) | ZB_INLINE_ASSERT_SIMPLE((expr)), |
Assert which can be used inside an expression.
| expr | Expression to check |
| #define ZB_ASSERT_COMPILE_TIME | ( | expr | ) | ((void)(zb_int_t (*)[(expr) ? 1 : -1])0) |
Checks condition at compile time in the code (not declaration block).
| expr | Expression to check |
Checks condition at compile time in the code (not declaration block), returns 0.
To be used inside expressions.
| expr | Expression to check |
| #define ZB_ASSERT_COMPILE_DECL | ( | expr | ) | typedef zb_int_t ZB_ASSERT_CAT(assert, __LINE__)[(expr) ? 1 : -1] |
Checks condition at compile time in the declaration block.
| expr | Expression to check |
| #define ZB_ASSERT_TYPE_SIZE_NOT_GREATER | ( | type, | |
| limit | |||
| ) | ZB_ASSERT_COMPILE_DECL(sizeof(type) <= (limit)) |
Ensures, that size of type 'type' is not greater than 'limit'.
If it is not, compilation is aborted.
| type | Type name |
| limit | Size limit |
| #define ZB_ASSERT_TYPE_SIZE_NOT_LESS | ( | type, | |
| limit | |||
| ) | ZB_ASSERT_COMPILE_DECL(sizeof(type) >= (limit)) |
Ensures, that size of type 'type' is not less than 'limit'.
If it is not, compilation is aborted.
| type | Type name |
| limit | Size limit |
| #define ZB_ASSERT_TYPE_SIZE_EQ | ( | type, | |
| limit | |||
| ) | ZB_ASSERT_COMPILE_DECL(sizeof(type) == (limit)) |
Ensures, that size of type 'type' is equal to the 'limit'.
If it is not, compilation is aborted.
| type | Type name |
| limit | Size limit |
| void zb_abort | ( | char * | caller_file, |
| int | caller_line | ||
| ) |
Traces current location, aborts current program execution - with core dump if possible.
| caller_file | Source file name |
| caller_line | Line in the source |
References TRACE_ERROR, and TRACE_MSG.
Asserts printing diagnostic and forcing a core dump.
| file_name | Source file name |
| line_number | Line in the source |
References TRACE_ERROR, and TRACE_MSG.