From: Vsevolod Stakhov Date: Mon, 11 May 2015 13:17:04 +0000 (+0100) Subject: Add workaround for glib < 2.30. X-Git-Tag: 0.9.0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d95cb903a5ac0134d66b74ea3aed6e86717e696;p=thirdparty%2Frspamd.git Add workaround for glib < 2.30. --- diff --git a/src/libutil/util.c b/src/libutil/util.c index a86f67b48f..6efe1b477a 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1463,6 +1463,20 @@ g_queue_clear (GQueue *queue) queue->length = 0; } #endif +#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 30)) +GPtrArray* +g_ptr_array_new_full (guint reserved_size, + GDestroyNotify element_free_func) +{ + GPtrArray *array; + + array = g_ptr_array_sized_new (reserved_size); + g_ptr_array_set_free_func (array, element_free_func); + + return array; +} +#endif + gsize rspamd_strlcpy (gchar *dst, const gchar *src, gsize siz)