* Version $Id$
*/
/*
- Copyright (C) 2004-2006 Kern Sibbald
+ Copyright (C) 2004-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
*
* 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;