[PATCH v2 06/21] node: use C11 alignof

Tyler Retzlaff roretzla at linux.microsoft.com
Tue Feb 13 19:34:37 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>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
 lib/node/node_private.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/node/node_private.h b/lib/node/node_private.h
index 73563e4..2b9bad1 100644
--- a/lib/node/node_private.h
+++ b/lib/node/node_private.h
@@ -5,6 +5,8 @@
 #ifndef __NODE_PRIVATE_H__
 #define __NODE_PRIVATE_H__
 
+#include <stdalign.h>
+
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_mbuf.h>
@@ -42,7 +44,7 @@ struct node_mbuf_priv1 {
 static const struct rte_mbuf_dynfield node_mbuf_priv1_dynfield_desc = {
 	.name = "rte_node_dynfield_priv1",
 	.size = sizeof(struct node_mbuf_priv1),
-	.align = __alignof__(struct node_mbuf_priv1),
+	.align = alignof(struct node_mbuf_priv1),
 };
 extern int node_mbuf_priv1_dynfield_offset;
 
-- 
1.8.3.1



More information about the dev mailing list