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

Message ID 1707849292-19519-7-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series use C11 alignof |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 13, 2024, 6:34 p.m. UTC
  Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/node/node_private.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

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;