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

Add support for Musl libc #798

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion os/generic_unix_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif
#include <sys/param.h>

#if __has_include(<sys/cdefs.h>)
#if __has_include(<sys/cdefs.h>) && (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__GLIBC__))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we're making this particular change. Musl (at least the copy I'm looking at) doesn't have <sys/cdefs.h>, so wouldn't have tried to include it anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Alpine /usr/include/sys/cdefs.h is present and it contains #warning usage of non-standard #include <sys/cdefs.h> is deprecated, which fails due to our usage of -Werror.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I wonder if we can work out why we're including <sys/cdefs.h> and just not do that anywhere.

#include <sys/cdefs.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions tests/dispatch_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#if __has_include(<sys/event.h>)
#define HAS_SYS_EVENT_H 1
#include <sys/event.h>
#else
#include <sys/poll.h>
#elif __has_include(<poll.h>)
#include <poll.h>
#endif
#elif defined(_WIN32)
#include <Windows.h>
Expand Down