X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Flib%2Fdlist.h;h=32933ad608518254b7205dc94949e0dc3736be86;hb=3f8a3a045ea058657030f588a10f786449d00e0d;hp=40c54f013379ee396a81b902b6bd5c9afa2599d2;hpb=f4bcd52673e6454e4f704ba75d073cf886052201;p=bacula%2Fbacula diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index 40c54f0133..32933ad608 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -2,7 +2,7 @@ * 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 @@ -36,15 +36,16 @@ * * 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;