aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSUZUKI, Shinsuke <suz@kame.net>2006-03-08 09:18:50 +0000
committerSUZUKI, Shinsuke <suz@kame.net>2006-03-08 09:18:50 +0000
commit6e0004c9ac746949cb252861ee9ad8331bb3436a (patch)
treedd6bd8ef7cbf62fa8ff481a3d5a874eb73dbe8f4
parent0a39737e45062532d6c28357ec2faca6395ed6df (diff)
fixed a compilation failure on linux
-rw-r--r--common.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/common.h b/common.h
index 03477cf..194829d 100644
--- a/common.h
+++ b/common.h
@@ -47,24 +47,43 @@
#ifndef TAILQ_EMPTY
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
#endif
+
+/* and linux *_FIRST and *_NEXT */
+#ifndef LIST_EMPTY
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+#endif
+#ifndef LIST_FIRST
+#define LIST_FIRST(head) ((head)->lh_first)
+#endif
+#ifndef LIST_NEXT
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+#endif
+#ifndef LIST_FOREACH
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = LIST_FIRST((head)); \
+ (var); \
+ (var) = LIST_NEXT((var), field))
+#endif
+#ifndef TAILQ_FIRST
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#endif
#ifndef TAILQ_LAST
#define TAILQ_LAST(head, headname) \
(*(((struct headname *)((head)->tqh_last))->tqh_last))
#endif
-#ifndef TAILQ_NEXT
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-#endif
#ifndef TAILQ_PREV
#define TAILQ_PREV(elm, headname, field) \
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
#endif
+#ifndef TAILQ_NEXT
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#endif
#ifndef TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field) \
for ((var) = TAILQ_FIRST((head)); \
(var); \
(var) = TAILQ_NEXT((var), field))
#endif
-
#ifndef TAILQ_FOREACH_REVERSE
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
for ((var) = TAILQ_LAST((head), headname); \
@@ -72,26 +91,6 @@
(var) = TAILQ_PREV((var), headname, field))
#endif
-/* and linux *_FIRST and *_NEXT */
-#ifndef LIST_FIRST
-#define LIST_FIRST(head) ((head)->lh_first)
-#endif
-#ifndef LIST_NEXT
-#define LIST_NEXT(elm, field) ((elm)->field.le_next)
-#endif
-#ifndef TAILQ_FIRST
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-#endif
-#ifndef TAILQ_NEXT
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-#endif
-#ifndef LIST_FOREACH
-#define LIST_FOREACH(var, head, field) \
- for ((var) = LIST_FIRST((head)); \
- (var); \
- (var) = LIST_NEXT((var), field))
-#endif
-
#ifndef SO_REUSEPORT
#define SO_REUSEPORT SO_REUSEADDR