From 6d95cb903a5ac0134d66b74ea3aed6e86717e696 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 11 May 2015 14:17:04 +0100 Subject: [PATCH] Add workaround for glib < 2.30. --- src/libutil/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libutil/util.c b/src/libutil/util.c index a86f67b48..6efe1b477 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) -- 2.39.5