summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-10-15 19:33:46 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-10-15 19:34:19 -0700
commit720d73c395bb2fcbae3566339a4102b485aa491d (patch)
tree47fbcb6ce4502868cfceb1db1173d6e88842b4e8 /lib
parent3a0f73ce978de44748e905053192735f67627ac6 (diff)
downloadgnulib-720d73c395bb2fcbae3566339a4102b485aa491d.tar.gz
nproc: port better to macOS 10.14
* lib/nproc.c (num_processors_ignoring_omp) [HAVE_SYSCTL && !defined __GLIBC__ && defined HW_NCPU]: Do not use a const mib, as macOS 10.14 rejects this.
Diffstat (limited to 'lib')
-rw-r--r--lib/nproc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/nproc.c b/lib/nproc.c
index a9e369dd3f..1af989d6dd 100644
--- a/lib/nproc.c
+++ b/lib/nproc.c
@@ -307,10 +307,11 @@ num_processors_ignoring_omp (enum nproc_query query)
NPROC_CURRENT and NPROC_ALL. */
#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_NCPU
- { /* This works on Mac OS X, FreeBSD, NetBSD, OpenBSD. */
+ { /* This works on macOS, FreeBSD, NetBSD, OpenBSD.
+ macOS 10.14 does not allow mib to be const. */
int nprocs;
size_t len = sizeof (nprocs);
- static int const mib[][2] = {
+ static int mib[][2] = {
# ifdef HW_NCPUONLINE
{ CTL_HW, HW_NCPUONLINE },
# endif