From 03a6c37729a279281d24710c4ee70cafa72cebb6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 26 Jun 2024 12:36:18 -0400 Subject: [PATCH] MT#55283 add t_list_find_custom() Typed variant of g_list_find_custom() Change-Id: I986b6b58fd10ac43edb6bb01b5c6006d4082d201 --- lib/containers.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/containers.h b/lib/containers.h index b87afcc47..cbe7f761e 100644 --- a/lib/containers.h +++ b/lib/containers.h @@ -294,6 +294,13 @@ __ret; \ }) +#define t_list_find_custom(L, e, f) ({ \ + int (*__f)(__typeof__((L)->__ct), const void *) = f; \ + GList *__l = g_list_find_custom(&(L)->l, e, (GCompareFunc) __f); \ + __typeof__(L) __ret = (__typeof__(L)) __l; \ + __ret; \ + }) + #define t_queue_clear(Q) ({ \ g_queue_clear(&(Q)->q); \ })