Replace use of __alignof__(T) with C11 alignof(T) to improve portability between toolchains.
Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com> Acked-by: Morten Brørup <m...@smartsharesystems.com> Acked-by: Chengwen Feng <fengcheng...@huawei.com> --- lib/ethdev/ethdev_driver.c | 3 ++- lib/ethdev/rte_flow.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c index bd917a1..4d45fbd 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -2,6 +2,7 @@ * Copyright(c) 2022 Intel Corporation */ +#include <stdalign.h> #include <stdlib.h> #include <pthread.h> @@ -633,7 +634,7 @@ struct rte_eth_dev * static const struct rte_mbuf_dynfield field_desc = { .name = RTE_MBUF_DYNFIELD_IP_REASSEMBLY_NAME, .size = sizeof(rte_eth_ip_reassembly_dynfield_t), - .align = __alignof__(rte_eth_ip_reassembly_dynfield_t), + .align = alignof(rte_eth_ip_reassembly_dynfield_t), }; static const struct rte_mbuf_dynflag ip_reassembly_dynflag = { .name = RTE_MBUF_DYNFLAG_IP_REASSEMBLY_INCOMPLETE_NAME, diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index f49d1d3..2cd30d6 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -3,6 +3,7 @@ * Copyright 2016 Mellanox Technologies, Ltd */ +#include <stdalign.h> #include <errno.h> #include <stddef.h> #include <stdint.h> @@ -281,7 +282,7 @@ struct rte_flow_desc_data { static const struct rte_mbuf_dynfield desc_offs = { .name = RTE_MBUF_DYNFIELD_METADATA_NAME, .size = sizeof(uint32_t), - .align = __alignof__(uint32_t), + .align = alignof(uint32_t), }; static const struct rte_mbuf_dynflag desc_flag = { .name = RTE_MBUF_DYNFLAG_METADATA_NAME, -- 1.8.3.1