spa: support: log: convert spa_log_topic_init() to a function

There is no reason for this to be a macro.
This commit is contained in:
Barnabás Pőcze 2023-10-06 00:50:35 +02:00 committed by Wim Taymans
parent 181fbfee6d
commit 0366a52f3a

View file

@ -194,15 +194,13 @@ struct spa_log_methods {
#define SPA_LOG_TOPIC(v, t) \
(struct spa_log_topic){ .version = (v), .topic = (t)}
#define spa_log_topic_init(l, topic) \
do { \
struct spa_log *_l = l; \
if (SPA_LIKELY(_l)) { \
struct spa_interface *_if = &_l->iface; \
spa_interface_call(_if, struct spa_log_methods, \
topic_init, 1, topic); \
} \
} while(0)
static inline void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic)
{
if (SPA_UNLIKELY(!log))
return;
spa_interface_call(&log->iface, struct spa_log_methods, topic_init, 1, topic);
}
/* Unused, left for backwards compat */
#define spa_log_level_enabled(l,lev) ((l) && (l)->level >= (lev))