From 4f1c7f2eef8e85bc294f47ad780761820364171f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 23 Aug 2017 16:41:53 -0400 Subject: [PATCH] Fix: global logging symbols defined multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- include/babeltrace/logging-internal.h | 8 ++++---- logging/log.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/babeltrace/logging-internal.h b/include/babeltrace/logging-internal.h index 08161030..ee93660f 100644 --- a/include/babeltrace/logging-internal.h +++ b/include/babeltrace/logging-internal.h @@ -353,10 +353,10 @@ * corresponding BT_LOG_DEFINE_XXX macro MUST be used exactly once somewhere. * Otherwise build will fail with link error (undefined symbol). */ -#define BT_LOG_DEFINE_TAG_PREFIX const char *_bt_log_tag_prefix -#define BT_LOG_DEFINE_GLOBAL_FORMAT bt_log_format _bt_log_global_format -#define BT_LOG_DEFINE_GLOBAL_OUTPUT bt_log_output _bt_log_global_output -#define BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL int _bt_log_global_output_lvl +#define BT_LOG_DEFINE_TAG_PREFIX BT_HIDDEN const char *_bt_log_tag_prefix +#define BT_LOG_DEFINE_GLOBAL_FORMAT BT_HIDDEN bt_log_format _bt_log_global_format +#define BT_LOG_DEFINE_GLOBAL_OUTPUT BT_HIDDEN bt_log_output _bt_log_global_output +#define BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL BT_HIDDEN int _bt_log_global_output_lvl /* Pointer to global format options. Direct modification is not allowed. Use * bt_log_set_mem_width() instead. Could be used to initialize bt_log_spec diff --git a/logging/log.c b/logging/log.c index 7af09e54..78a0361d 100644 --- a/logging/log.c +++ b/logging/log.c @@ -685,6 +685,7 @@ static const bt_log_output out_stderr = {BT_LOG_OUT_STDERR}; BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = 0; #endif +BT_HIDDEN const bt_log_spec _bt_log_stderr_spec = { BT_LOG_GLOBAL_FORMAT, -- 2.34.1