Merge pull request #21943 from vrabaud:3.4_proc

* Fix compilation with non glibc.

_SC_NPROCESSORS_ONLN is non standard as defined on https://man7.org/linux/man-pages/man3/sysconf.3.html
It seems to only be on glibc, cf https://www.gnu.org/software/libc/manual/html_node/Processor-Resources.html

* Fix to defined(_SC_NPROCESSORS_ONLN)
pull/21917/head^2
Vincent Rabaud 3 years ago committed by GitHub
parent 039f3d01a0
commit 667e5e4f89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/core/src/parallel.cpp

@ -942,7 +942,7 @@ int getNumberOfCPUs_()
#endif
#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && defined(_SC_NPROCESSORS_ONLN)
static unsigned cpu_count_sysconf = (unsigned)sysconf( _SC_NPROCESSORS_ONLN );
ncpus = minNonZero(ncpus, cpu_count_sysconf);

Loading…
Cancel
Save