X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Flib%2Fdlist.h;h=32933ad608518254b7205dc94949e0dc3736be86;hb=3f8a3a045ea058657030f588a10f786449d00e0d;hp=ce975f486593d27e729eaac27bf435274228d289;hpb=4f97db494e3f35d5458781c229d470b26aef75ec;p=bacula%2Fbacula diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index ce975f4865..32933ad608 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -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;