Skip to content

Commit 858dadd

Browse files
committed
Fixed Alpine/musl builds: include unistd.h in gcc-preinclude
GCC 13 on Alpine (musl) has a bug where atomic_wait.h uses syscall() without including <unistd.h>. On glibc this isn't needed because _GNU_SOURCE pulls it in, so the include is conditional on musl only.
1 parent 20a3bd2 commit 858dadd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gcc-preinclude.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ __asm__(".symver pow,pow@GLIBC_2.17");
2626
__asm__(".symver fcntl64,fcntl@GLIBC_2.17");
2727
#endif
2828

29+
#else
30+
// musl libc: pull in syscall() for GCC 13's atomic_wait.h
31+
#include <unistd.h>
2932
#endif
3033
#endif

0 commit comments

Comments
 (0)