[1/9] ring: use C11 alignof
Checks
Commit Message
Replace use of __alignof__(e) with C11 alignof(typeof(e)) to improve
portability between toolchains
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ring/rte_ring.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -7,6 +7,7 @@
* Used as BSD-3 Licensed with permission from Kip Macy.
*/
+#include <stdalign.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
@@ -288,7 +289,7 @@ struct rte_ring *
* rte_errno for us appropriately - hence no check in this function
*/
mz = rte_memzone_reserve_aligned(mz_name, ring_size, socket_id,
- mz_flags, __alignof__(*r));
+ mz_flags, alignof(typeof(*r)));
if (mz != NULL) {
r = mz->addr;
/* no need to check return value here, we already checked the