From c130ec9de9c3ee57f74c324df19387efa7e20348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 23 Dec 2023 18:40:43 +0100 Subject: [PATCH] pipewire: log: fix concatenation in log topic macros `__LINE__` was not expanded previously. Fix that. --- src/pipewire/log.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pipewire/log.h b/src/pipewire/log.h index b1cdc4c52..7729d3e9d 100644 --- a/src/pipewire/log.h +++ b/src/pipewire/log.h @@ -6,6 +6,7 @@ #define PIPEWIRE_LOG_H #include +#include #ifdef __cplusplus extern "C" { @@ -84,8 +85,8 @@ pw_log_logv(enum spa_log_level level, * \endcode */ #define PW_LOG_TOPIC_STATIC(var, topic) \ - static struct spa_log_topic var##__LINE__ = SPA_LOG_TOPIC(0, topic); \ - static struct spa_log_topic *var = &(var##__LINE__) + static struct spa_log_topic SPA_CONCAT(var, __LINE__) = SPA_LOG_TOPIC(0, topic); \ + static struct spa_log_topic *var = &SPA_CONCAT(var, __LINE__) /** * Declare a static log topic named \a var. @@ -99,8 +100,8 @@ pw_log_logv(enum spa_log_level level, * See \ref PW_LOG_TOPIC_STATIC for an example usage. */ #define PW_LOG_TOPIC(var, topic) \ - struct spa_log_topic var##__LINE__ = SPA_LOG_TOPIC(0, topic); \ - struct spa_log_topic *var = &(var##__LINE__) + struct spa_log_topic SPA_CONCAT(var, __LINE__) = SPA_LOG_TOPIC(0, topic); \ + struct spa_log_topic *var = &SPA_CONCAT(var, __LINE__) #define PW_LOG_TOPIC_INIT(var) \ spa_log_topic_init(pw_log_get(), var);