mirror of
https://github.com/opencv/opencv.git
synced 2025-07-26 07:07:37 +08:00
Fix build for non-linux architectures but still glibc-based
Exampls of these are gnu/kfreebsd and gnu/hurd, both available as unofficial Debian ports. They don't define __linux__ (as they are non-linux…) but still define __GLIBC__, so check on that. Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
This commit is contained in:
parent
110af09bf9
commit
d026d7dcfb
@ -52,7 +52,7 @@
|
|||||||
#undef abs
|
#undef abs
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __linux__ || defined __APPLE__
|
#if defined __linux__ || defined __APPLE__ || defined __GLIBC__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -672,7 +672,7 @@ int cv::getNumberOfCPUs(void)
|
|||||||
#elif defined __ANDROID__
|
#elif defined __ANDROID__
|
||||||
static int ncpus = getNumberOfCPUsImpl();
|
static int ncpus = getNumberOfCPUsImpl();
|
||||||
return ncpus;
|
return ncpus;
|
||||||
#elif defined __linux__
|
#elif defined __linux__ || defined __GLIBC__
|
||||||
return (int)sysconf( _SC_NPROCESSORS_ONLN );
|
return (int)sysconf( _SC_NPROCESSORS_ONLN );
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
int numCPU=0;
|
int numCPU=0;
|
||||||
|
@ -215,7 +215,7 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
|
|||||||
#include "omp.h"
|
#include "omp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ || defined __HAIKU__
|
#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ || defined __GLIBC__ || defined __HAIKU__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user