diff options
Diffstat (limited to 'lib/linklist.h')
| -rw-r--r-- | lib/linklist.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/linklist.h b/lib/linklist.h index 0475391e9f..76fad45d08 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -21,6 +21,10 @@ #ifndef _ZEBRA_LINKLIST_H #define _ZEBRA_LINKLIST_H +#ifdef __cplusplus +extern "C" { +#endif + /* listnodes must always contain data to be valid. Adding an empty node * to a list is invalid */ @@ -291,7 +295,8 @@ extern void list_add_list(struct list *list, struct list *add); #define ALL_LIST_ELEMENTS(list, node, nextnode, data) \ (node) = listhead(list), ((data) = NULL); \ (node) != NULL \ - && ((data) = listgetdata(node), (nextnode) = node->next, 1); \ + && ((data) = static_cast(data, listgetdata(node)), \ + (nextnode) = node->next, 1); \ (node) = (nextnode), ((data) = NULL) /* read-only list iteration macro. @@ -302,7 +307,7 @@ extern void list_add_list(struct list *list, struct list *add); */ #define ALL_LIST_ELEMENTS_RO(list, node, data) \ (node) = listhead(list), ((data) = NULL); \ - (node) != NULL && ((data) = listgetdata(node), 1); \ + (node) != NULL && ((data) = static_cast(data, listgetdata(node)), 1); \ (node) = listnextnode(node), ((data) = NULL) /* these *do not* cleanup list nodes and referenced data, as the functions @@ -336,4 +341,8 @@ extern void list_add_list(struct list *list, struct list *add); (L)->count--; \ } while (0) +#ifdef __cplusplus +} +#endif + #endif /* _ZEBRA_LINKLIST_H */ |
