mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 04:12:52 +08:00
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)
This commit is contained in:
parent
039f3d01a0
commit
667e5e4f89
@ -942,7 +942,7 @@ int getNumberOfCPUs_()
|
|||||||
|
|
||||||
#endif
|
#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 );
|
static unsigned cpu_count_sysconf = (unsigned)sysconf( _SC_NPROCESSORS_ONLN );
|
||||||
ncpus = minNonZero(ncpus, cpu_count_sysconf);
|
ncpus = minNonZero(ncpus, cpu_count_sysconf);
|
||||||
|
Loading…
Reference in New Issue
Block a user