cmAffinity: Add include for CPU_ZERO on Alpine Linux

The definition of `CPU_ZERO` requires `<string.h>` to be included
explicitly for `memset`.  Since IWYU does not agree on other Linux
platforms, use a pragma to silence the warning.

Fixes: #19643
This commit is contained in:
Brad King
2019-08-27 09:32:32 -04:00
parent 40bbe50e23
commit 1902e39746
+2
View File
@@ -12,6 +12,8 @@
# define CM_HAVE_CPU_AFFINITY
# include <pthread.h>
# include <sched.h>
// On some platforms CPU_ZERO needs memset but sched.h forgets string.h
# include <string.h> // IWYU pragma: keep
# if defined(__FreeBSD__)
# include <pthread_np.h>
# include <sys/cpuset.h>