add documentation for srsran_assert and srsran_expect macros

This commit is contained in:
Francisco 2021-03-23 09:46:28 +00:00 committed by Francisco Paisana
parent dd336c53ea
commit 46d46e70ff
1 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,10 @@
#define srsran_unlikely(expr) __builtin_expect(!!(expr), 0)
/**
* Macro that asserts condition is true. If false, it logs the remaining parameters, prints the backtrace and closes
* the application
*/
#define srsran_assert(condition, fmt, ...) \
do { \
if (srsran_unlikely(not(condition))) { \
@ -32,6 +36,10 @@
#ifdef STOP_ON_WARNING
/**
* Macro that verifies if condition is true. If false, and STOP_ON_WARNING is true, it behaves like srsran_assert.
* If STOP_ON_WARNING is false, it logs a warning.
*/
#define srsran_expect(condition, fmt, ...) srsran_assert(condition, fmt, ##__VA_ARGS__)
#else // STOP_ON_WARNING