From a46822ff257dd3376126ef20c8f102fe564fa75c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 1 Aug 2024 08:13:38 -0400 Subject: [PATCH] MT#55283 compile fix for older glib by moving the glib helper into containers.h Change-Id: I09bba2343cbbbaf4f9aba7fc89740d4fa6280927 --- lib/auxlib.h | 7 ------- lib/containers.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/auxlib.h b/lib/auxlib.h index 3694871a24..7f46b1dd0e 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -440,13 +440,6 @@ 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 ***/ diff --git a/lib/containers.h b/lib/containers.h index cbe7f761e0..6025af3eeb 100644 --- a/lib/containers.h +++ b/lib/containers.h @@ -5,6 +5,13 @@ #include #include +#if !(GLIB_CHECK_VERSION(2,60,0)) +static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { + void *p; + while ((p = g_queue_pop_head(q))) + free_func(p); +} +#endif #define TYPED_GHASHTABLE_PROTO(type_name, key_type, value_type) \ typedef union { \