[PATCH 7/9] pdcp: use C11 alignof

Tyler Retzlaff roretzla at linux.microsoft.com
Thu Jan 25 00:17:54 CET 2024


Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.

Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 lib/pdcp/rte_pdcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/pdcp/rte_pdcp.c b/lib/pdcp/rte_pdcp.c
index 1c6d246..1c076fb 100644
--- a/lib/pdcp/rte_pdcp.c
+++ b/lib/pdcp/rte_pdcp.c
@@ -2,6 +2,8 @@
  * Copyright(C) 2023 Marvell.
  */
 
+#include <stdalign.h>
+
 #include <rte_errno.h>
 #include <rte_pdcp.h>
 #include <rte_malloc.h>
@@ -32,7 +34,7 @@ struct entity_layout {
 	const struct rte_mbuf_dynfield dynfield_desc = {
 		.name = RTE_PDCP_DYNFIELD_NAME,
 		.size = sizeof(rte_pdcp_dynfield_t),
-		.align = __alignof__(rte_pdcp_dynfield_t),
+		.align = alignof(rte_pdcp_dynfield_t),
 	};
 
 	if (rte_pdcp_dynfield_offset != -1)
-- 
1.8.3.1



More information about the dev mailing list