[v2,14/21] event/sw: use C11 alignof

Message ID 1707849292-19519-15-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>
---
 drivers/event/sw/sw_evdev_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index e6646e5..a2ce140 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -2,6 +2,7 @@ 
  * Copyright(c) 2016-2017 Intel Corporation
  */
 
+#include <stdalign.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
@@ -3201,7 +3202,7 @@  struct test_event_dev_stats {
 	static const struct rte_mbuf_dynfield counter_dynfield_desc = {
 		.name = "rte_event_sw_dynfield_selftest_counter",
 		.size = sizeof(counter_dynfield_t),
-		.align = __alignof__(counter_dynfield_t),
+		.align = alignof(counter_dynfield_t),
 	};
 	counter_dynfield_offset =
 		rte_mbuf_dynfield_register(&counter_dynfield_desc);