From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0F16D7FCB for ; Mon, 1 Dec 2014 12:38:58 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 01 Dec 2014 03:38:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,493,1413270000"; d="scan'208";a="646155194" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 01 Dec 2014 03:38:57 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sB1BcuiM012905; Mon, 1 Dec 2014 11:38:56 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sB1Bctg9029241; Mon, 1 Dec 2014 11:38:55 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id sB1BctHV029233; Mon, 1 Dec 2014 11:38:55 GMT From: Bruce Richardson To: dev@dpdk.org Date: Mon, 1 Dec 2014 11:38:55 +0000 Message-Id: <1417433935-29181-3-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1417433935-29181-1-git-send-email-bruce.richardson@intel.com> References: <1417433935-29181-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 2/2] testpmd: fix macro check for little endian X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 11:38:59 -0000 Compiling with clang on FreeBSD gave a compilation error: app/test-pmd/csumonly.c:84:5: fatal error: '__BYTE_ORDER' is not defined, evaluates to 0 [-Wundef] Querying the preprocessor defines show both the define and value used are incorrect. $ clang -dM -E - < /dev/null | grep BYTE \#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ Changing the check to __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ then resolves the issue. Signed-off-by: Bruce Richardson --- app/test-pmd/csumonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index d8c080a..6f43761 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -81,7 +81,7 @@ /* 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 == __LITTLE_ENDIAN +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define _htons(x) ((uint16_t)((((x) & 0x00ffU) << 8) | (((x) & 0xff00U) >> 8))) #else #define _htons(x) (x) -- 2.1.0