[dpdk-dev] [PATCH] test-pmd: Fix "__BYTE_ORDER__" not defined error
Thomas Monjalon
thomas.monjalon at 6wind.com
Wed Dec 3 20:59:44 CET 2014
2014-12-03 16:26, Qiu, Michael:
> > --- a/app/test-pmd/csumonly.c
> > +++ b/app/test-pmd/csumonly.c
> > @@ -81,7 +81,13 @@
> >
> > /* we cannot use htons() from arpa/inet.h due to name conflicts, and we
> > * cannot use rte_cpu_to_be_16() on a constant in a switch/case */
> > -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
> > +#ifdef __BYTE_ORDER__
> > +#define LITTLE_ENDIAN_CHECK (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
> > +#else
> > +#define LITTLE_ENDIAN_CHECK (__BYTE_ORDER == __LITTLE_ENDIAN)
> > +#endif
> > +
> > +#if LITTLE_ENDIAN_CHECK
> > #define _htons(x) ((uint16_t)((((x) & 0x00ffU) << 8) | (((x) & 0xff00U) >> 8)))
> > #else
> > #define _htons(x) (x)
I don't agree we should fix it in testpmd.
It's a more general problem which must be solved in EAL.
I'm preparing a patchset to fix it.
--
Thomas
More information about the dev
mailing list