From 125657e1088394ff09962c48a2cee4dbe4efe7ca Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 24 Aug 2023 10:44:26 -0400 Subject: [PATCH] MT#56374 move glib helper to auxlib Needed by perf-tester Change-Id: I9fcb68e48938a2060498bf30ff7ffbdd38c6d94b --- include/helpers.h | 7 ------- lib/auxlib.h | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/helpers.h b/include/helpers.h index ebc84dafc..3b58c7a13 100644 --- a/include/helpers.h +++ b/include/helpers.h @@ -130,13 +130,6 @@ INLINE void g_queue_truncate(GQueue *q, unsigned int len) { while (q->length > len) g_queue_pop_tail(q); } -#if !(GLIB_CHECK_VERSION(2,60,0)) -INLINE void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { - void *p; - while ((p = g_queue_pop_head(q))) - free_func(p); -} -#endif INLINE void g_queue_append(GQueue *dst, const GQueue *src) { GList *l; if (!src || !dst) diff --git a/lib/auxlib.h b/lib/auxlib.h index 7d8807680..a57ffe01a 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -410,6 +410,14 @@ INLINE gboolean g_hash_table_steal_extended(GHashTable *ht, gconstpointer lookup } #endif +#if !(GLIB_CHECK_VERSION(2,60,0)) +INLINE void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { + void *p; + while ((p = g_queue_pop_head(q))) + free_func(p); +} +#endif + /*** MISC ***/