From c7373548901d3cb00562f677ef4b950428569e8b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 10 Oct 2022 10:35:30 -0700 Subject: [PATCH] Avoid depending on `max_align_t` in <__struct_sockaddr.h>. `max_align_t` is not declared in C99 mode, so use an aligned attribute and `__BIGGEST_ALIGNMENT__` instead. Fixes WebAssembly/wasi-sdk#111. --- libc-bottom-half/headers/public/__struct_sockaddr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc-bottom-half/headers/public/__struct_sockaddr.h b/libc-bottom-half/headers/public/__struct_sockaddr.h index 668fde3e5..9891b90be 100644 --- a/libc-bottom-half/headers/public/__struct_sockaddr.h +++ b/libc-bottom-half/headers/public/__struct_sockaddr.h @@ -7,7 +7,7 @@ #include <__typedef_sa_family_t.h> struct sockaddr { - _Alignas(max_align_t) sa_family_t sa_family; + __attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sa_family; char sa_data[0]; };