]> git.proxmox.com Git - wasi-libc.git/commitdiff
Avoid depending on `max_align_t` in <__struct_sockaddr.h>.
authorDan Gohman <dev@sunfishcode.online>
Mon, 10 Oct 2022 17:35:30 +0000 (10:35 -0700)
committerDan Gohman <dev@sunfishcode.online>
Mon, 10 Oct 2022 18:04:26 +0000 (11:04 -0700)
`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

index 668fde3e5c350e1be07ce796b5dbfb41134674a2..9891b90bea4fdb71b1fbbe714959078b049a30f0 100644 (file)
@@ -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];
 };