Commit 2e284924 authored by Kieran Bingham's avatar Kieran Bingham Committed by Nícolas F. R. A. Prado
Browse files

libcamera: internal: log: Report function on asserts



Report the function which fails an assertion as well as the actual
assertion.
Signed-off-by: default avatarKieran Bingham <kieran.bingham@ideasonboard.com>
parent 7fd4d6d4
......@@ -121,9 +121,10 @@ LogMessage _log(const char *file, unsigned int line,
#endif /* __DOXYGEN__ */
#ifndef NDEBUG
#define ASSERT(condition) static_cast<void>(({ \
if (!(condition)) \
LOG(Fatal) << "assertion \"" #condition "\" failed"; \
#define ASSERT(condition) static_cast<void>(({ \
if (!(condition)) \
LOG(Fatal) << "assertion \"" #condition "\" failed in " \
<< __func__ << "()"; \
}))
#else
#define ASSERT(condition) static_cast<void>(false && (condition))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment