<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Fix building with musl libc

https://github.com/apple/swift-corelibs-libdispatch/pull/594/
https://bugs.gentoo.org/829158
https://bugs.gentoo.org/833306

--- a/dispatch/source.h
+++ b/dispatch/source.h
@@ -32,7 +32,7 @@
 #endif
 
 #if !defined(_WIN32)
-#include &lt;sys/signal.h&gt;
+#include &lt;signal.h&gt;
 #endif
 
 DISPATCH_ASSUME_NONNULL_BEGIN
--- a/os/generic_unix_base.h
+++ b/os/generic_unix_base.h
@@ -25,6 +25,14 @@
 
 #if __has_include(&lt;sys/cdefs.h&gt;)
 #include &lt;sys/cdefs.h&gt;
+#else
+#if defined(__cplusplus)
+#define	__BEGIN_DECLS extern "C" {
+#define	__END_DECLS }
+#else
+#define	__BEGIN_DECLS
+#define	__END_DECLS
+#endif
 #endif
 
 #ifndef API_AVAILABLE
--- a/src/shims/getprogname.h
+++ b/src/shims/getprogname.h
@@ -37,7 +37,7 @@
 static inline char *
 getprogname(void)
 {
-# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME || defined(__linux__)
 	return program_invocation_short_name;
 # elif defined(__ANDROID__)
 	return __progname;
--- a/tests/dispatch_test.c
+++ b/tests/dispatch_test.c
@@ -34,7 +34,7 @@
 #define HAS_SYS_EVENT_H 1
 #include &lt;sys/event.h&gt;
 #else
-#include &lt;sys/poll.h&gt;
+#include &lt;poll.h&gt;
 #endif
 #elif defined(_WIN32)
 #include &lt;Windows.h&gt;
</pre></body></html>