diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-11 14:17:04 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-11 14:17:04 +0100 |
commit | 6d95cb903a5ac0134d66b74ea3aed6e86717e696 (patch) | |
tree | c3ae094c4f4f35919e4777fc6c911dc2ebba2982 | |
parent | 9987019e75a2ead35a5c9bcb0ac310dd1635f18a (diff) | |
download | rspamd-6d95cb903a5ac0134d66b74ea3aed6e86717e696.tar.gz rspamd-6d95cb903a5ac0134d66b74ea3aed6e86717e696.zip |
Add workaround for glib < 2.30.
-rw-r--r-- | src/libutil/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
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) |