1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #25832 from chachoi-world:4.x

Add support for QNX #25832

Build and test instruction for QNX:
https://github.com/chachoi-world/qnx-ports/blob/main/opencv/README.md

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
James Choi
2024-08-06 13:25:39 -04:00
committed by GitHub
parent d8bcc2c85d
commit 582a7f32d5
9 changed files with 68 additions and 12 deletions
@@ -13,7 +13,7 @@
/* not supported */
# elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \
defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ || \
defined __GNU__
defined __GNU__ || defined __QNX__
# define OPENCV_HAVE_FILESYSTEM_SUPPORT 1
# elif defined(__APPLE__)
# include <TargetConditionals.h>
+7 -1
View File
@@ -72,6 +72,10 @@
#endif
#endif
#if defined (__QNX__)
#include <sys/syspage.h>
#endif
#ifndef OPENCV_DISABLE_THREAD_SUPPORT
#include <thread>
#endif
@@ -1011,7 +1015,9 @@ int getNumberOfCPUs_()
static unsigned cpu_count_sysconf = (unsigned)sysconf( _SC_NPROCESSORS_ONLN );
ncpus = minNonZero(ncpus, cpu_count_sysconf);
#elif defined (__QNX__)
static unsigned cpu_count_sysconf = _syspage_ptr->num_cpu;
ncpus = minNonZero(ncpus, cpu_count_sysconf);
#endif
return ncpus != 0 ? ncpus : 1;
+9
View File
@@ -46,6 +46,15 @@
#include <iostream>
#include <ostream>
#ifdef __QNX__
#include <unistd.h>
#include <sys/neutrino.h>
#include <sys/syspage.h>
#ifdef __aarch64__
#include <aarch64/syspage.h>
#endif
#endif
#include <opencv2/core/utils/configuration.private.hpp>
#include <opencv2/core/utils/trace.private.hpp>
+4 -4
View File
@@ -34,7 +34,7 @@
#include <errno.h>
#include <io.h>
#include <stdio.h>
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__ || defined __QNX__
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -194,7 +194,7 @@ cv::String getcwd()
sz = GetCurrentDirectoryA((DWORD)buf.size(), buf.data());
return cv::String(buf.data(), (size_t)sz);
#endif
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__ || defined __QNX__
for(;;)
{
char* p = ::getcwd(buf.data(), buf.size());
@@ -228,7 +228,7 @@ bool createDirectory(const cv::String& path)
#else
int result = _mkdir(path.c_str());
#endif
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__ || defined __QNX__
int result = mkdir(path.c_str(), 0777);
#else
int result = -1;
@@ -343,7 +343,7 @@ private:
Impl& operator=(const Impl&); // disabled
};
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__ || defined __QNX__
struct FileLock::Impl
{
+2 -1
View File
@@ -1035,7 +1035,8 @@ static std::string findData(const std::string& relative_path, bool required, boo
}
}
#ifdef OPENCV_TEST_DATA_INSTALL_PATH
datapath = path_join("./", OPENCV_TEST_DATA_INSTALL_PATH);
datapath = OPENCV_TEST_DATA_INSTALL_PATH;
if (isDirectory(datapath))
{
for(size_t i = search_subdir.size(); i > 0; i--)