This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
- version 2 as ammended with additional clauses defined in the
+ version 2 as amended with additional clauses defined in the
file LICENSE in the main source directory.
This program is distributed in the hope that it will be useful,
*
* Loop var through each member of list
*/
+#ifdef HAVE_GCC
#define foreach_dlist(var, list) \
- for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); )
-
-#ifdef the_old_way
+ for((var)=NULL; ((var)=(typeof(var))(list)->next(var)); )
+#else
#define foreach_dlist(var, list) \
- for((var)=NULL; (((void *)(var))=(list)->next(var)); )
+ for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); )
#endif
+
struct dlink {
void *next;
void *prev;