diff options
Diffstat (limited to 'source4/include/dlinklist.h')
-rw-r--r-- | source4/include/dlinklist.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/include/dlinklist.h b/source4/include/dlinklist.h index f1ceb8acf3..6191299384 100644 --- a/source4/include/dlinklist.h +++ b/source4/include/dlinklist.h @@ -57,16 +57,17 @@ do { \ } while (0) /* hook into the end of the list - needs a tmp pointer */ -#define DLIST_ADD_END(list, p, tmp) \ +#define DLIST_ADD_END(list, p, type) \ do { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ } else { \ - for ((tmp) = (list); (tmp)->next; (tmp) = (tmp)->next) ; \ - (tmp)->next = (p); \ + type tmp; \ + for (tmp = (list); tmp->next; tmp = tmp->next) ; \ + tmp->next = (p); \ (p)->next = NULL; \ - (p)->prev = (tmp); \ + (p)->prev = tmp; \ } \ } while (0) |