Browse Source

MT#61625 add t_slist_free_full wrapper

Change-Id: Ib47bc4890ecfeac5a6814505abe77b4454cda5e3
pull/1918/head
Richard Fuchs 10 months ago
parent
commit
8ab206c26a
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      lib/containers.h

+ 5
- 0
lib/containers.h View File

@ -407,6 +407,11 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
__ret; \
})
#define t_slist_free_full(L, f) ({ \
void (*__fn)(__typeof__((L)->data)) = (f); \
g_slist_free_full(&(L)->l, (GDestroyNotify) __fn); \
})
#define t_slist_delete_link(L, k) ({ \
GSList *__r = g_slist_delete_link(&(L)->l, &(k)->l); \
__typeof__(L) __ret = (__typeof__(L)) __r; \


Loading…
Cancel
Save