Skip to content

Commit

Permalink
Use __BIGGEST_ALIGNMENT__ instead of max_align_t (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt authored Jan 9, 2023
1 parent f2aac5f commit a1c7c2c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
3 changes: 0 additions & 3 deletions libc-bottom-half/headers/public/__struct_sockaddr.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef __wasilibc___struct_sockaddr_h
#define __wasilibc___struct_sockaddr_h

#define __need_STDDEF_H_misc
#include <stddef.h>

#include <__typedef_sa_family_t.h>

struct sockaddr {
Expand Down
5 changes: 1 addition & 4 deletions libc-bottom-half/headers/public/__struct_sockaddr_in.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#ifndef __wasilibc___struct_sockaddr_in_h
#define __wasilibc___struct_sockaddr_in_h

#define __need_STDDEF_H_misc
#include <stddef.h>

#include <__typedef_sa_family_t.h>
#include <__typedef_in_port_t.h>
#include <__struct_in_addr.h>

struct sockaddr_in {
_Alignas(max_align_t) sa_family_t sin_family;
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
};
Expand Down
5 changes: 1 addition & 4 deletions libc-bottom-half/headers/public/__struct_sockaddr_in6.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#ifndef __wasilibc___struct_sockaddr_in6_h
#define __wasilibc___struct_sockaddr_in6_h

#define __need_STDDEF_H_misc
#include <stddef.h>

#include <__typedef_sa_family_t.h>
#include <__typedef_in_port_t.h>
#include <__struct_in6_addr.h>

struct sockaddr_in6 {
_Alignas(max_align_t) sa_family_t sin6_family;
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sin6_family;
in_port_t sin6_port;
unsigned sin6_flowinfo;
struct in6_addr sin6_addr;
Expand Down
5 changes: 1 addition & 4 deletions libc-bottom-half/headers/public/__struct_sockaddr_storage.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#ifndef __wasilibc___struct_sockaddr_storage_h
#define __wasilibc___struct_sockaddr_storage_h

#define __need_STDDEF_H_misc
#include <stddef.h>

#include <__typedef_sa_family_t.h>

struct sockaddr_storage {
_Alignas(max_align_t) sa_family_t ss_family;
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t ss_family;
char __ss_data[32];
};

Expand Down
5 changes: 1 addition & 4 deletions libc-bottom-half/headers/public/__struct_sockaddr_un.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#ifndef __wasilibc___struct_sockaddr_un_h
#define __wasilibc___struct_sockaddr_un_h

#define __need_STDDEF_H_misc
#include <stddef.h>

#include <__typedef_sa_family_t.h>

struct sockaddr_un {
_Alignas(max_align_t) sa_family_t sun_family;
__attribute__((aligned(__BIGGEST_ALIGNMENT__))) sa_family_t sun_family;
};

#endif

0 comments on commit a1c7c2c

Please sign in to comment.