From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] test-pmd: Fix "__BYTE_ORDER__" not defined error Date: Wed, 03 Dec 2014 20:59:44 +0100 Message-ID: <283531301.lWbIahXLyM@xps13> References: <1417606044-3432-1-git-send-email-michael.qiu@intel.com> <533710CFB86FA344BFBF2D6802E60286C9C636@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Qiu, Michael" Return-path: In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9C636-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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