From 18883e7945041f1f870c3ac5d963ef96680b1591 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Thu, 22 Jun 2023 16:49:23 +0100 Subject: [PATCH 1/3] Add support for Musl libc Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html), it requires additional checks for available headers. --- os/generic_unix_base.h | 2 +- tests/dispatch_test.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/os/generic_unix_base.h b/os/generic_unix_base.h index b77d2adaa..4c8dc3513 100644 --- a/os/generic_unix_base.h +++ b/os/generic_unix_base.h @@ -25,7 +25,7 @@ #endif #include -#if __has_include() +#if __has_include() && defined(__GLIBC__) #include #endif diff --git a/tests/dispatch_test.c b/tests/dispatch_test.c index d84a7b228..5c2aef948 100644 --- a/tests/dispatch_test.c +++ b/tests/dispatch_test.c @@ -33,6 +33,8 @@ #if __has_include() #define HAS_SYS_EVENT_H 1 #include +#elif __has_include() +#include #else #include #endif From 145becc59135f1e464ed66ebab12ded8ff43da72 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Thu, 22 Jun 2023 16:56:06 +0100 Subject: [PATCH 2/3] Avoid possible BSD regression in `os/generic_unix_base.h` Co-authored-by: Saleem Abdulrasool --- os/generic_unix_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/generic_unix_base.h b/os/generic_unix_base.h index 4c8dc3513..049e9b63b 100644 --- a/os/generic_unix_base.h +++ b/os/generic_unix_base.h @@ -25,7 +25,7 @@ #endif #include -#if __has_include() && defined(__GLIBC__) +#if __has_include() && (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__GLIBC__)) #include #endif From a90e25cd0559ae29c9b55dd73cf4c67c1272de13 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 4 Jul 2023 16:28:10 +0100 Subject: [PATCH 3/3] Update `poll.h` include in `dispatch_test.c` --- tests/dispatch_test.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/dispatch_test.c b/tests/dispatch_test.c index 5c2aef948..56ebab4f2 100644 --- a/tests/dispatch_test.c +++ b/tests/dispatch_test.c @@ -35,8 +35,6 @@ #include #elif __has_include() #include -#else -#include #endif #elif defined(_WIN32) #include