From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] net/mlx5: fix build on PPC64 Date: Wed, 7 Nov 2018 17:00:28 +0100 Message-ID: <20181107160028.5938-1-thomas@monjalon.net> References: <20180903092911.GU3695@6wind.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: christian.ehrhardt@canonical.com, adrien.mazarguil@6wind.com, shahafs@mellanox.com, yskoh@mellanox.com, gowrishankar.m@linux.vnet.ibm.com, chaozhu@linux.vnet.ibm.com, pradeep@us.ibm.com, tyos@jp.ibm.com, dwilder@us.ibm.com To: dev@dpdk.org Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id B6E7E14EC for ; Wed, 7 Nov 2018 17:02:28 +0100 (CET) In-Reply-To: <20180903092911.GU3695@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The AltiVec header file breaks boolean type: error: incompatible types when initializing type '__vector _bool int' {aka '_vector(4) __bool int'} using type 'int' If __APPLE_ALTIVEC__ is defined, then bool type is redefined and conflicts with stdbool.h. There is no good solution to fix it for the whole project without breaking something else, so a workaround is inserted in mlx5 PMD. This workaround is not compatible with C++ but there is no C++ in DPDK. Suggested-by: Christian Ehrhardt Suggested-by: Adrien Mazarguil Signed-off-by: Thomas Monjalon --- drivers/net/mlx5/mlx5_utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h index 886f60e61..97092c749 100644 --- a/drivers/net/mlx5/mlx5_utils.h +++ b/drivers/net/mlx5/mlx5_utils.h @@ -15,6 +15,16 @@ #include "mlx5_defs.h" +/* + * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. + * Otherwise there would be a type conflict between stdbool and altivec. + */ +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif + /* Bit-field manipulation. */ #define BITFIELD_DECLARE(bf, type, size) \ type bf[(((size_t)(size) / (sizeof(type) * CHAR_BIT)) + \ -- 2.19.0