From: Vsevolod Stakhov Date: Wed, 14 Dec 2011 12:01:18 +0000 (+0300) Subject: Add another workaround for CentOS. X-Git-Tag: 0.4.6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7072f8548414cf0e88babd7556f1f893c93ba3dc;p=thirdparty%2Frspamd.git Add another workaround for CentOS. --- diff --git a/src/util.c b/src/util.c index 2efd8f0d57..dea3976f1b 100644 --- a/src/util.c +++ b/src/util.c @@ -1124,6 +1124,17 @@ g_ptr_array_unref (GPtrArray *array) g_ptr_array_free (array, TRUE); } #endif +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14)) +void +g_queue_clear (GQueue *queue) +{ + g_return_if_fail (queue != NULL); + + g_list_free (queue->head); + queue->head = queue->tail = NULL; + queue->length = 0; +} +#endif gsize rspamd_strlcpy (gchar *dst, const gchar *src, gsize siz) diff --git a/src/util.h b/src/util.h index 95d5703bd7..165b843348 100644 --- a/src/util.h +++ b/src/util.h @@ -172,11 +172,14 @@ gboolean fstr_strcase_equal (gconstpointer v, gconstpointer v2); void gperf_profiler_init (struct config_file *cfg, const gchar *descr); /* - * Workaround for older versions of glib + * Workarounds for older versions of glib */ #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 22)) void g_ptr_array_unref (GPtrArray *array); #endif +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14)) +void g_queue_clear (GQueue *queue); +#endif /*