From 71717ac7fffd688d5f9245aa008b79ea8e8f6fce Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Mon, 21 Oct 2024 16:46:50 +0200 Subject: [PATCH 1/2] log: make log macros compilable with c++ without warnings Signed-off-by: Martin Geier --- lib/wp/log.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wp/log.h b/lib/wp/log.h index 76c10798..0b3aefad 100644 --- a/lib/wp/log.h +++ b/lib/wp/log.h @@ -69,11 +69,11 @@ typedef struct { extern WpLogTopic * var; #define WP_LOG_TOPIC(var, name) \ - WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC }; \ + WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, { NULL } }; \ WpLogTopic * var = &(var##_struct); #define WP_LOG_TOPIC_STATIC(var, name) \ - static WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC }; \ + static WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, { NULL } }; \ static G_GNUC_UNUSED WpLogTopic * var = &(var##_struct); #define WP_DEFINE_LOCAL_LOG_TOPIC(name) \ From 83b94c88310b6b8cb7e2760eaf8d283fcbe6e807 Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Thu, 18 Dec 2025 16:48:06 +0100 Subject: [PATCH 2/2] fixup! log: make log macros compilable with c++ without warnings --- lib/wp/log.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wp/log.h b/lib/wp/log.h index 0b3aefad..d835188c 100644 --- a/lib/wp/log.h +++ b/lib/wp/log.h @@ -69,11 +69,11 @@ typedef struct { extern WpLogTopic * var; #define WP_LOG_TOPIC(var, name) \ - WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, { NULL } }; \ + WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, ._wp_padding = { NULL } }; \ WpLogTopic * var = &(var##_struct); #define WP_LOG_TOPIC_STATIC(var, name) \ - static WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, { NULL } }; \ + static WpLogTopic var##_struct = { .topic_name = name, .flags = WP_LOG_TOPIC_FLAG_STATIC, ._wp_padding = { NULL } }; \ static G_GNUC_UNUSED WpLogTopic * var = &(var##_struct); #define WP_DEFINE_LOCAL_LOG_TOPIC(name) \