]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: cpu-count - fix compilation using musl
authorFabian Groffen <grobian@gentoo.org>
Sat, 31 May 2025 08:49:28 +0000 (10:49 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Tue, 10 Jun 2025 09:50:50 +0000 (11:50 +0200)
The macros, types and symbols CPU_* and cpuset_t are not exposed in
musl's sched.h unless _GNU_SOURCE is set.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
src/lib/cpu-count.c

index 3eb38fa47d8def802b7a54a3c80d45fea5dedd4c..a3e80e6c15770196e3df7a7d9f88245df579669d 100644 (file)
@@ -3,6 +3,8 @@
 
 #ifdef HAVE_SCHED_H
 #  define __USE_GNU
+/* _GNU_SOURCE: for musl's sched.h to expose cpuset/CPU_* */
+#  define _GNU_SOURCE
 #  include <sched.h>
 #  ifdef HAVE_SYS_CPUSET_H
 #    include <sys/cpuset.h>