qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT bb150dc] Add LIST_FOREACH_SAFE() definition


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT bb150dc] Add LIST_FOREACH_SAFE() definition
Date: Wed, 09 Sep 2009 22:36:47 -0000

From: Juan Quintela <address@hidden>

Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/sys-queue.h b/sys-queue.h
index cb6a4c8..eb89a4d 100644
--- a/sys-queue.h
+++ b/sys-queue.h
@@ -126,6 +126,11 @@ struct {                                                   
             \
                 (var);                                                  \
                 (var) = ((var)->field.le_next))
 
+#define LIST_FOREACH_SAFE(var, head, field, next_var)                   \
+        for ((var) = ((head)->lh_first);                                \
+                (var) && ((next_var) = ((var)->field.le_next), 1);      \
+                (var) = (next_var))
+
 /*
  * List access methods.
  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]