libcamera: base: log: Inline LOG() into ASSERT()
Avoid the conditional logic in the expansion of `LOG()` inside `ASSERT()` by directly calling `_log(...)` with the appropriate parameters. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -132,8 +132,9 @@ LogMessage _log(const LogCategory &category, LogSeverity severity,
|
||||
#ifndef NDEBUG
|
||||
#define ASSERT(condition) static_cast<void>(({ \
|
||||
if (!(condition)) \
|
||||
LOG(Fatal) << "assertion \"" #condition "\" failed in " \
|
||||
<< __func__ << "()"; \
|
||||
_log(LogCategory::defaultCategory(), LogFatal).stream() \
|
||||
<< "assertion \"" #condition "\" failed in " \
|
||||
<< __func__ << "()"; \
|
||||
}))
|
||||
#else
|
||||
#define ASSERT(condition) static_cast<void>(false && (condition))
|
||||
|
||||
Reference in New Issue
Block a user