27 #ifndef PURPLE_GLIBCOMPAT_H
28 #define PURPLE_GLIBCOMPAT_H
34 #if !GLIB_CHECK_VERSION(2,28,0)
36 g_list_free_full(GList *l, GDestroyNotify free_func) {
39 for(ll = l; ll != NULL; ll = ll->next) {
47 g_slist_free_full(GSList *l, GDestroyNotify free_func) {
50 for(ll = l; ll != NULL; ll = ll->next) {
58 #if !GLIB_CHECK_VERSION(2,32,0)
59 # define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
60 # define G_GNUC_END_IGNORE_DEPRECATIONS
63 g_queue_free_full(GQueue *queue, GDestroyNotify free_func) {
66 for(l = queue->head; l != NULL; l = l->next) {
73 static inline gboolean
74 g_hash_table_contains(GHashTable *hash_table, gconstpointer key) {
75 return g_hash_table_lookup_extended(hash_table, key, NULL, NULL);
82 #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
83 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
84 _Pragma ("clang diagnostic push") \
85 _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"")
87 #undef G_GNUC_END_IGNORE_DEPRECATIONS
88 #define G_GNUC_END_IGNORE_DEPRECATIONS \
89 _Pragma ("clang diagnostic pop")
97 #if !GLIB_CHECK_VERSION(2, 67, 3)
98 static inline gpointer
99 g_memdup2(gconstpointer mem, gsize byte_size) {
100 gpointer new_mem = NULL;
102 if(mem && byte_size != 0) {
103 new_mem = g_malloc (byte_size);
104 memcpy (new_mem, mem, byte_size);