From 54f94b1303a9efb025016e824468b72a82b8d29b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 26 Jul 2019 20:49:01 +0100 Subject: [PATCH] =?UTF-8?q?gmessages:=20Only=20use=20structured=20logs=20i?= =?UTF-8?q?f=20GLIB=5FVERSION=5FMAX=5FALLOWED=20is=20=E2=89=A52.56?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only redefine g_message() and friends to use structured logging if the compiling code is OK with depending on GLib functionality from ≥2.56. Signed-off-by: Philip Withnall Fixes: #1847 --- glib/gmessages.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/gmessages.h b/glib/gmessages.h index c609d087f..95d60c5be 100644 --- a/glib/gmessages.h +++ b/glib/gmessages.h @@ -296,7 +296,7 @@ void g_log_structured_standard (const gchar *log_domain, #endif /* G_LOG_DOMAIN */ #if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING -#ifdef G_LOG_USE_STRUCTURED +#if defined(G_LOG_USE_STRUCTURED) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 #define g_error(...) G_STMT_START { \ g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \ __FILE__, G_STRINGIFY (__LINE__), \ @@ -345,7 +345,7 @@ void g_log_structured_standard (const gchar *log_domain, __VA_ARGS__) #endif #elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING -#ifdef G_LOG_USE_STRUCTURED +#if defined(G_LOG_USE_STRUCTURED) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 #define g_error(format...) G_STMT_START { \ g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \ __FILE__, G_STRINGIFY (__LINE__), \