From bfb4248653da561cfa5e013cea574602162aee4a Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 7 Aug 2012 16:20:16 +0200 Subject: Check GLib version for GDateTime and GTimeZone ISS' Jenkins build server has GLib 2.24 which does not have these time related functions. --- test/benchmark.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/benchmark.c b/test/benchmark.c index f221731..7e66405 100644 --- a/test/benchmark.c +++ b/test/benchmark.c @@ -57,13 +57,14 @@ static void log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user) { gsize n_written; - GIOChannel *channel; + GError *error = NULL; + GIOChannel *channel = user; + +#if GLIB_CHECK_VERSION(2, 26, 0) GTimeZone *tz; GDateTime *date_time; gchar *new_message; - GError *error = NULL; - channel = user; tz = g_time_zone_new_local (); date_time = g_date_time_new_now (tz); @@ -75,6 +76,10 @@ log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *mes g_io_channel_write_chars (channel, new_message, strlen (new_message), &n_written, &error); g_assert_no_error (error); +#else + g_io_channel_write_chars (channel, message, strlen (message), &n_written, &error); + g_assert_no_error (error); +#endif g_io_channel_flush (channel, &error); g_assert_no_error (error); -- cgit v1.2.3