Skip to content

Commit 8936247

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 8936247

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gcc-preinclude.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
#define _GNU_SOURCE
66
#include <features.h>
7+
#include <unistd.h>
78
#undef _GNU_SOURCE
89

9-
#if defined(__USE_GNU)
10+
#if defined(__GLIBC__)
1011

1112
#if defined(__x86_64__)
1213
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");

0 commit comments

Comments
 (0)