Skip to content

Commit

Permalink
Avoid depending on max_align_t in <__struct_sockaddr.h>.
Browse files Browse the repository at this point in the history
`max_align_t` is not declared in C99 mode, so use an aligned attribute
and `__BIGGEST_ALIGNMENT__` instead.

Fixes WebAssembly/wasi-sdk#111.
  • Loading branch information
sunfishcode committed Oct 10, 2022
1 parent 099caae commit c737354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc-bottom-half/headers/public/__struct_sockaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand Down

0 comments on commit c737354

Please sign in to comment.