Hi

> From: dev <dev-boun...@dpdk.org> On Behalf Of Christian Ehrhardt
> 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.
> 
> Related to:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.dp
> dk.org%2Fdpdk%2Fcommit%2F%3Fid%3D725f5dd0bfb50192a2d2341d4cc690
> 84c2c4e03d&amp;data=02%7C01%7Cmatan%40mellanox.com%7Ccaefd20ac0
> 39441c69a508d71fe16f1b%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C
> 0%7C637012925402095536&amp;sdata=RP9wpAJeUdQGfEvzqlDubKsj9hHw7
> 5fEgs0JVIMTfPc%3D&amp;reserved=0
> 
> Change-Id: Iceb058c07086def4176c5ab199ca4dd5018d0340

No need the Change-Id ...

> Signed-off-by: Christian Ehrhardt <christian.ehrha...@canonical.com>

Besides that,
Acked-by: Matan Azrad <ma...@mellanox.com>

Thanks

> ---
>  drivers/net/mlx4/mlx4_utils.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
> index a49190252..74b9d2ecd 100644
> --- a/drivers/net/mlx4/mlx4_utils.h
> +++ b/drivers/net/mlx4/mlx4_utils.h
> @@ -15,6 +15,16 @@
> 
>  #include "mlx4.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
> +
>  extern int mlx4_logtype;
> 
>  #ifndef NDEBUG
> --
> 2.22.0

Reply via email to