From 3708aaeaff5041040783bd252768fadf2b794ec2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 23 Mar 2009 12:05:07 +0000 Subject: [PATCH] util: Add a new macro for testing empty lists. --- src/gallium/auxiliary/util/u_double_list.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/util/u_double_list.h b/src/gallium/auxiliary/util/u_double_list.h index d108d92e52b..53bb1342ddc 100644 --- a/src/gallium/auxiliary/util/u_double_list.h +++ b/src/gallium/auxiliary/util/u_double_list.h @@ -95,5 +95,8 @@ struct list_head #define LIST_ENTRY(__type, __item, __field) \ ((__type *)(((char *)(__item)) - offsetof(__type, __field))) +#define LIST_IS_EMPTY(__list) \ + ((__list)->next == (__list)) + #endif /*_U_DOUBLE_LIST_H_*/ -- 2.30.2