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

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
---
 examples/bbdev_app/main.c      | 3 ++-
 examples/rxtx_callbacks/main.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index ef9cd29..16599ae 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -2,6 +2,7 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <stdalign.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1051,7 +1052,7 @@ uint16_t bbdev_parse_number(const char *mask)
        static const struct rte_mbuf_dynfield input_dynfield_desc = {
                .name = "example_bbdev_dynfield_input",
                .size = sizeof(struct rte_mbuf *),
-               .align = __alignof__(struct rte_mbuf *),
+               .align = alignof(struct rte_mbuf *),
        };
 
        __atomic_store_n(&global_exit_flag, 0, __ATOMIC_RELAXED);
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 59eee49..4682921 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -2,6 +2,7 @@
  * Copyright(c) 2010-2015 Intel Corporation
  */
 
+#include <stdalign.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <inttypes.h>
@@ -292,7 +293,7 @@
        static const struct rte_mbuf_dynfield tsc_dynfield_desc = {
                .name = "example_bbdev_dynfield_tsc",
                .size = sizeof(tsc_t),
-               .align = __alignof__(tsc_t),
+               .align = alignof(tsc_t),
        };
 
        /* init EAL */
-- 
1.8.3.1

Reply via email to