From: Vsevolod Stakhov Date: Mon, 16 Nov 2015 16:44:33 +0000 (+0000) Subject: Add another bloody workaround for old glib X-Git-Tag: 1.1.0~544 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8ba838fc116cade384bbadb013fc181121d480b;p=thirdparty%2Frspamd.git Add another bloody workaround for old glib --- diff --git a/src/libutil/util.c b/src/libutil/util.c index ed9d78abe5..286ec5091f 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1352,6 +1352,22 @@ g_ptr_array_new_full (guint reserved_size, return array; } #endif +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 32)) +void +g_queue_free_full (GQueue *queue, GDestroyNotify free_func) +{ + GList *cur; + + cur = queue->head; + + while (cur) { + free_func (cur->data); + cur = g_list_next (cur); + } + + g_queue_free (queue); +} +#endif guint rspamd_url_hash (gconstpointer u) diff --git a/src/libutil/util.h b/src/libutil/util.h index 75aa4850ad..c2e0f1605a 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -181,7 +181,9 @@ void g_ptr_array_unref (GPtrArray *array); #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14)) void g_queue_clear (GQueue *queue); #endif - +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 32)) +void g_queue_free_full (GQueue *queue, GDestroyNotify free_func); +#endif /* * Convert milliseconds to timeval fields