diff --git a/modules/core/include/opencv2/core/utils/filesystem.private.hpp b/modules/core/include/opencv2/core/utils/filesystem.private.hpp index 73f56d435b..deca4a4f95 100644 --- a/modules/core/include/opencv2/core/utils/filesystem.private.hpp +++ b/modules/core/include/opencv2/core/utils/filesystem.private.hpp @@ -12,7 +12,7 @@ # elif defined WINRT /* not supported */ # elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \ - defined __FreeBSD__ || defined __bsdi__ + defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ # define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 # elif defined(__APPLE__) # include diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 93d4e6c8ba..7ef2fdc5ed 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -53,7 +53,8 @@ #undef abs #endif -#if defined __linux__ || defined __APPLE__ || defined __GLIBC__ +#if defined __linux__ || defined __APPLE__ || defined __GLIBC__ \ + || defined __HAIKU__ #include #include #include @@ -721,7 +722,7 @@ int cv::getNumberOfCPUs(void) #elif defined __ANDROID__ static int ncpus = getNumberOfCPUsImpl(); return ncpus; -#elif defined __linux__ || defined __GLIBC__ +#elif defined __linux__ || defined __GLIBC__ || defined __HAIKU__ return (int)sysconf( _SC_NPROCESSORS_ONLN ); #elif defined __APPLE__ int numCPU=0; diff --git a/modules/core/src/utils/filesystem.cpp b/modules/core/src/utils/filesystem.cpp index 1aa0d3d0f8..9af7e14e89 100644 --- a/modules/core/src/utils/filesystem.cpp +++ b/modules/core/src/utils/filesystem.cpp @@ -34,7 +34,7 @@ #include #include #include -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ #include #include #include @@ -161,7 +161,7 @@ cv::String getcwd() sz = GetCurrentDirectoryA((DWORD)buf.size(), (char*)buf); return cv::String((char*)buf, (size_t)sz); #endif -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ for(;;) { char* p = ::getcwd((char*)buf, buf.size()); @@ -195,7 +195,7 @@ bool createDirectory(const cv::String& path) #else int result = _mkdir(path.c_str()); #endif -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ int result = mkdir(path.c_str(), 0777); #else int result = -1; @@ -310,7 +310,7 @@ private: Impl& operator=(const Impl&); // disabled }; -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ struct FileLock::Impl { @@ -424,7 +424,7 @@ cv::String getCacheDirectory(const char* sub_directory_name, const char* configu default_cache_path = "/tmp/"; CV_LOG_WARNING(NULL, "Using world accessible cache directory. This may be not secure: " << default_cache_path); } -#elif defined __linux__ +#elif defined __linux__ || defined __HAIKU__ // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if (default_cache_path.empty()) { diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 8ca304abe5..de600302a1 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -101,7 +101,7 @@ extern "C" { long tv_nsec; }; #endif -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ #include #include #include @@ -298,7 +298,7 @@ static int get_number_of_cpus(void) GetSystemInfo( &sysinfo ); return (int)sysinfo.dwNumberOfProcessors; -#elif defined __linux__ +#elif defined __linux__ || defined __HAIKU__ return (int)sysconf( _SC_NPROCESSORS_ONLN ); #elif defined __APPLE__ int numCPU=0;