diff options
author | Brad King <brad.king@kitware.com> | 2019-08-26 13:26:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-27 13:32:32 (GMT) |
commit | 1902e39746ba2aaaa3ef1918e3b14d96023966df (patch) | |
tree | 488bc05413bd3d0d649d5e5d0cffb3ccdbab8013 /Source | |
parent | 40bbe50e23c06232ccf1c49589dde5dd84e1ac31 (diff) | |
download | CMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.zip CMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.tar.gz CMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.tar.bz2 |
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
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAffinity.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx index 588b2f2..09b0298 100644 --- a/Source/cmAffinity.cxx +++ b/Source/cmAffinity.cxx @@ -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> |