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