On Tue, Nov 12, 2013 at 02:42:26PM +0100, Jiri Benc wrote:

> +#define LIST_FOREACH_SAFE(var, tmp, head, field)                     \
> +     for ((var) = ((head)->lh_first),                                \
> +          (tmp) = (var) ? ((var)->field.le_next) : NULL;             \
> +          (var);                                                     \
> +          (var) = (tmp),                                             \
> +          (tmp) = (var) ? ((var)->field.le_next) : NULL)
> +

Hm...

I get this when cross compiling for m68k:

/home/richard/git/linuxptp/clock.c:117:0: error: "LIST_FOREACH_SAFE" redefined 
[-Werror]
/home/richard/x-toolchain-m68k/install/bin/../m68k-uclinux/libc/usr/include/sys/queue.h:358:0:
 note: this is the location of the previous definition
cc1: all warnings being treated as errors

That queue.h has the following definition:

#define LIST_FOREACH_SAFE(var, head, field, tvar)                       \
        for ((var) = LIST_FIRST((head));                                \
            (var) && ((tvar) = LIST_NEXT((var), field), 1);             \
            (var) = (tvar))

For Xscale ixp, the toolchain header also has this defined already in
the same way.

On my debian system I find

  /usr/include/i386-linux-gnu/sys/queue.h
  /usr/include/bsd/sys/queue.h

and this second version also defines LIST_FOREACH_SAFE in the same
way.

Can you place the macro in clock.c inside an #ifndef?

Also, can you explain why the definitions are different?

Thanks,
Richard




------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to