1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
--- a/libpurple/glibcompat.h 2016-11-21 09:38:39.250858177 -0300
+++ b/libpurple/glibcompat.h 2016-11-21 09:39:44.789845560 -0300
@@ -66,6 +66,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 \
|