@@ -5,6 +5,7 @@
#include "test.h"
#include <unistd.h>
+#include <stdalign.h>
#include <string.h>
#include <rte_cycles.h>
#include <rte_errno.h>
@@ -831,7 +832,7 @@ int test_error_distributor_create_numworkers(void)
static const struct rte_mbuf_dynfield seq_dynfield_desc = {
.name = "test_distributor_dynfield_seq",
.size = sizeof(seq_dynfield_t),
- .align = __alignof__(seq_dynfield_t),
+ .align = alignof(seq_dynfield_t),
};
seq_dynfield_offset =
rte_mbuf_dynfield_register(&seq_dynfield_desc);
@@ -7,6 +7,7 @@
#include <assert.h>
#include <inttypes.h>
#include <signal.h>
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -935,7 +936,7 @@ struct test_node_register {
static const struct rte_mbuf_dynfield graph_dynfield_desc = {
.name = "test_graph_dynfield",
.size = sizeof(graph_dynfield_t),
- .align = __alignof__(graph_dynfield_t),
+ .align = alignof(graph_dynfield_t),
};
graph_dynfield_offset =
rte_mbuf_dynfield_register(&graph_dynfield_desc);
@@ -5,6 +5,7 @@
#include "test.h"
#include <string.h>
+#include <stdalign.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -2534,19 +2535,19 @@ struct test_case {
const struct rte_mbuf_dynfield dynfield = {
.name = "test-dynfield",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield2 = {
.name = "test-dynfield2",
.size = sizeof(uint16_t),
- .align = __alignof__(uint16_t),
+ .align = alignof(uint16_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield3 = {
.name = "test-dynfield3",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0,
};
const struct rte_mbuf_dynfield dynfield_fail_big = {
@@ -2564,7 +2565,7 @@ struct test_case {
const struct rte_mbuf_dynfield dynfield_fail_flag = {
.name = "test-dynfield",
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 1,
};
const struct rte_mbuf_dynflag dynflag_fail_flag = {
@@ -2,6 +2,8 @@
* Copyright(c) 2020 Intel Corporation
*/
+#include <stdalign.h>
+
#include "test_ring_stress.h"
/**
@@ -285,7 +287,7 @@ struct ring_elem {
*data = NULL;
sz = num * sizeof(*elm);
- elm = rte_zmalloc(NULL, sz, __alignof__(*elm));
+ elm = rte_zmalloc(NULL, sz, alignof(typeof(*elm)));
if (elm == NULL) {
printf("%s: alloc(%zu) for %u elems data failed",
__func__, sz, num);
@@ -297,7 +299,7 @@ struct ring_elem {
/* alloc ring */
nr = 2 * num;
sz = rte_ring_get_memsize(nr);
- r = rte_zmalloc(NULL, sz, __alignof__(*r));
+ r = rte_zmalloc(NULL, sz, alignof(typeof(*r)));
if (r == NULL) {
printf("%s: alloc(%zu) for FIFO with %u elems failed",
__func__, sz, nr);