--- a/libpurple/glibcompat.h 2016-11-21 09:38:39.250858177 -0300 +++ b/libpurple/glibcompat.h 2016-11-21 09:39:44.789845560 -0300 @@ -71,6 +71,30 @@ /****************************************************************************** * g_assert_* macros *****************************************************************************/ + +#if !GLIB_CHECK_VERSION(2, 32, 0) +static inline GByteArray * g_byte_array_new_take(guint8 *data, gsize len) +{ + GByteArray *array; + + array = g_byte_array_new(); + g_byte_array_append(array, data, len); + g_free(data); + + return array; +} + +static inline void g_queue_free_full(GQueue *queue, GDestroyNotify free_func) +{ + g_queue_foreach(queue, (GFunc)free_func, NULL); + g_queue_free(queue); +} +#endif + +#if !GLIB_CHECK_VERSION(2, 30, 0) +#define G_VALUE_INIT {0, {{0}}} +#endif + #if !GLIB_CHECK_VERSION(2, 38, 0) #define g_assert_true(expr) G_STMT_START { \ if G_LIKELY (expr) ; else \