Thread (40 messages) 40 messages, 8 authors, 2024-02-14
STALE894d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 6/9] node: use C11 alignof

From: Tyler Retzlaff <hidden>
Date: 2024-01-24 23:18:31
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

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

Signed-off-by: Tyler Retzlaff <redacted>
---
 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 845fdaa..92acb9b 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help