> -----Original Message-----
> From: Joyce Kong <joyce.k...@arm.com>
> Sent: Monday, July 6, 2020 3:49 PM
> To: maxime.coque...@redhat.com; jer...@marvell.com;
> zhihong.w...@intel.com; xiaolong...@intel.com; beilei.x...@intel.com;
> jia....@intel.com; john.mcnam...@intel.com; ma...@mellanox.com;
> shah...@mellanox.com; viachesl...@mellanox.com; Honnappa Nagarahalli
> <honnappa.nagaraha...@arm.com>; Phil Yang <phil.y...@arm.com>;
> Ruifeng Wang <ruifeng.w...@arm.com>
> Cc: dev@dpdk.org; nd <n...@arm.com>
> Subject: [PATCH v2 1/6] lib/eal: add a common wrapper for restricted
> pointers
>
> The 'restrict' keyword is recognized in C99, while type qulifier '__restrict'
> compiles ok in C with all language levels. This patch is to add a wrapper
> defining '__rte_restrict' with 'restrict' and '__restrict' to be supported by
> all
> compilers.
>
> Signed-off-by: Joyce Kong <joyce.k...@arm.com>
> ---
> lib/librte_eal/include/rte_common.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/lib/librte_eal/include/rte_common.h
> b/lib/librte_eal/include/rte_common.h
> index 0843ce69e..cda32c056 100644
> --- a/lib/librte_eal/include/rte_common.h
> +++ b/lib/librte_eal/include/rte_common.h
> @@ -103,6 +103,16 @@ typedef uint16_t unaligned_uint16_t;
> */
> #define __rte_unused __attribute__((__unused__))
>
> +/**
> + * Define a wrapper for restricted pointers which can be supported
> + * by all compilers.
> + */
> +#if __STDC_VERSION__ >= 199901
> +#define __rte_restrict restrict
> +#else
> +#define __rte_restrict __restrict
> +#endif
> +
> /**
> * definition to mark a variable or function parameter as used so
> * as to avoid a compiler warning
> --
> 2.27.0
Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com>