summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-07-26 20:49:01 +0100
committerPhilip Withnall <withnall@endlessm.com>2019-07-29 11:01:58 +0100
commit0519199cce24e85ba605a82e81e71ea598feba0b (patch)
tree6862f8a56568b73638f069496d9486851e1368f6
parent0a63daa96426715498b55318f68a67baee40c509 (diff)
downloadglib-0519199cce24e85ba605a82e81e71ea598feba0b.tar.gz
gmessages: Only use structured logs if GLIB_VERSION_MAX_ALLOWED is ≥2.56
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 <withnall@endlessm.com> Fixes: #1847
-rw-r--r--glib/gmessages.h4
1 files 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__), \