Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use __BIGGEST_ALIGNMENT__ instead of max_align_t #375

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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