Skip to content

Commit a1c7c2c

Browse files
authored
Use __BIGGEST_ALIGNMENT__ instead of max_align_t (#375)
Also, remove no longer necessary __need_STDDEF_H_misc stuff. References: #335 WebAssembly/wasi-sdk#111 https://github.com/llvm/llvm-project/blob/2e999b7dd1934a44d38c3a753460f1e5a217e9a5/clang/lib/Headers/stddef.h#L106-L113
1 parent f2aac5f commit a1c7c2c

File tree

5 files changed

+4
-19
lines changed

5 files changed

+4
-19
lines changed

libc-bottom-half/headers/public/__struct_sockaddr.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#ifndef __wasilibc___struct_sockaddr_h
22
#define __wasilibc___struct_sockaddr_h
33

4-
#define __need_STDDEF_H_misc
5-
#include <stddef.h>
6-
74
#include <__typedef_sa_family_t.h>
85

96
struct sockaddr {

libc-bottom-half/headers/public/__struct_sockaddr_in.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#ifndef __wasilibc___struct_sockaddr_in_h
22
#define __wasilibc___struct_sockaddr_in_h
33

4-
#define __need_STDDEF_H_misc
5-
#include <stddef.h>
6-
74
#include <__typedef_sa_family_t.h>
85
#include <__typedef_in_port_t.h>
96
#include <__struct_in_addr.h>
107

118
struct sockaddr_in {
12-
_Alignas(max_align_t) sa_family_t sin_family;
9+
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin_family;
1310
in_port_t sin_port;
1411
struct in_addr sin_addr;
1512
};

libc-bottom-half/headers/public/__struct_sockaddr_in6.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#ifndef __wasilibc___struct_sockaddr_in6_h
22
#define __wasilibc___struct_sockaddr_in6_h
33

4-
#define __need_STDDEF_H_misc
5-
#include <stddef.h>
6-
74
#include <__typedef_sa_family_t.h>
85
#include <__typedef_in_port_t.h>
96
#include <__struct_in6_addr.h>
107

118
struct sockaddr_in6 {
12-
_Alignas(max_align_t) sa_family_t sin6_family;
9+
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin6_family;
1310
in_port_t sin6_port;
1411
unsigned sin6_flowinfo;
1512
struct in6_addr sin6_addr;

libc-bottom-half/headers/public/__struct_sockaddr_storage.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#ifndef __wasilibc___struct_sockaddr_storage_h
22
#define __wasilibc___struct_sockaddr_storage_h
33

4-
#define __need_STDDEF_H_misc
5-
#include <stddef.h>
6-
74
#include <__typedef_sa_family_t.h>
85

96
struct sockaddr_storage {
10-
_Alignas(max_align_t) sa_family_t ss_family;
7+
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t ss_family;
118
char __ss_data[32];
129
};
1310

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#ifndef __wasilibc___struct_sockaddr_un_h
22
#define __wasilibc___struct_sockaddr_un_h
33

4-
#define __need_STDDEF_H_misc
5-
#include <stddef.h>
6-
74
#include <__typedef_sa_family_t.h>
85

96
struct sockaddr_un {
10-
_Alignas(max_align_t) sa_family_t sun_family;
7+
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sun_family;
118
};
129

1310
#endif

0 commit comments

Comments
 (0)