Make the LIST_FOREACH_SAFE publicly visible.

We will want to use this macro in more than one source file.  This patch
moves the macro into the common header for possibly undefined code.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2018-03-31 11:05:57 -07:00
parent d465406106
commit 992e292055
2 changed files with 7 additions and 7 deletions

View File

@ -134,13 +134,6 @@ static int cid_eq(struct ClockIdentity *a, struct ClockIdentity *b)
return 0 == memcmp(a, b, sizeof(*a));
}
#ifndef LIST_FOREACH_SAFE
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = LIST_FIRST((head)); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#endif
static void remove_subscriber(struct clock_subscriber *s)
{
LIST_REMOVE(s, list);

View File

@ -60,6 +60,13 @@ enum {
};
#endif
#ifndef LIST_FOREACH_SAFE
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = LIST_FIRST((head)); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#endif
#ifndef SIOCGHWTSTAMP
#define SIOCGHWTSTAMP 0x89b1
#endif