summaryrefslogtreecommitdiffstats
path: root/test/benchmark.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-08-07 16:20:16 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-08-07 16:20:16 +0200
commitbfb4248653da561cfa5e013cea574602162aee4a (patch)
tree8aa0ee2d06c5f75899e9713588ec0791814e4881 /test/benchmark.c
parent399ff33fe9ee40867486df64f50f129c88501daa (diff)
downloadlibuca-bfb4248653da561cfa5e013cea574602162aee4a.tar.gz
libuca-bfb4248653da561cfa5e013cea574602162aee4a.tar.bz2
libuca-bfb4248653da561cfa5e013cea574602162aee4a.tar.xz
libuca-bfb4248653da561cfa5e013cea574602162aee4a.zip
Check GLib version for GDateTime and GTimeZone
ISS' Jenkins build server has GLib 2.24 which does not have these time related functions.
Diffstat (limited to 'test/benchmark.c')
-rw-r--r--test/benchmark.c11
1 files 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);