Fixes for QNX 6.6 Neitrino support.

This commit is contained in:
Alexander Smorkalov
2014-10-23 13:01:42 +04:00
parent a77a2f357c
commit 6bb6039ebb
10 changed files with 190 additions and 19 deletions

View File

@@ -77,15 +77,34 @@ namespace cv
return list;
}
#ifdef __QNX__
// you have to ask QNX to please include more file information
// and not to report duplicate names as a result of file system unions
if ( -1 == dircntl(dp, D_SETFLAG, D_FLAG_STAT|D_FLAG_FILTER) )
return list;
#endif
while ((dirp = readdir(dp)) != NULL)
{
#ifdef __QNX__
// QNX looks at the world a little differently
dirent_extra *extra;
dirent_extra_stat *extra_stat;
for (extra = _DEXTRA_FIRST(dirp),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra);
_DEXTRA_VALID(extra, dirp);
extra = _DEXTRA_NEXT(extra),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra))
if ((extra->d_type != _DTYPE_NONE) && S_ISREG(extra_stat->d_stat.st_mode))
#else
if (dirp->d_type == DT_REG)
#endif
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
}
closedir(dp);
@@ -124,15 +143,15 @@ namespace cv
{
do
{
#ifdef HAVE_WINRT
#ifdef HAVE_WINRT
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&
wcscmp(FindFileData.cFileName, L".") != 0 &&
wcscmp(FindFileData.cFileName, L"..") != 0)
#else
#else
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&
strcmp(FindFileData.cFileName, ".") != 0 &&
strcmp(FindFileData.cFileName, "..") != 0)
#endif
#endif
{
char* fname;
#ifdef HAVE_WINRT
@@ -167,9 +186,29 @@ namespace cv
return list;
}
#ifdef __QNX__
// you have to ask QNX to please include more file information
// and not to report duplicate names as a result of file system unions
if ( -1 == dircntl(dp, D_SETFLAG, D_FLAG_STAT|D_FLAG_FILTER) )
return list;
#endif
while ((dirp = readdir(dp)) != NULL)
{
#ifdef __QNX__
// QNX looks at the world a little differently
dirent_extra *extra;
dirent_extra_stat *extra_stat;
for (extra = _DEXTRA_FIRST(dirp),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra);
_DEXTRA_VALID(extra, dirp);
extra = _DEXTRA_NEXT(extra),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra))
if ((extra->d_type != _DTYPE_NONE) &&
S_ISDIR(extra_stat->d_stat.st_mode) &&
#else
if (dirp->d_type == DT_DIR &&
#endif
strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0 )
{

View File

@@ -3750,8 +3750,15 @@ template<typename _Tp> inline ptrdiff_t operator - (const SeqIterator<_Tp>& a,
const SeqIterator<_Tp>& b)
{
ptrdiff_t delta = a.index - b.index, n = a.seq->total;
#if defined(__QNX__)
// No long std::abs(long) in QNX
long absdelta = (delta < 0) ? -delta : delta;
if( absdelta > n )
#else
if( std::abs(static_cast<long>(delta)) > n )
#endif
delta += delta < 0 ? n : -n;
return delta;
}

View File

@@ -157,7 +157,7 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
#include <stdarg.h>
#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__
#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __QNX__
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>

View File

@@ -45,9 +45,16 @@
(see otherlibs/_graphics/readme.txt for copyright notice)
\****************************************************************************************/
#include <stdarg.h>
#include "precomp.hpp"
#include "grfmt_tiff.hpp"
#ifdef HAVE_TIFF
# include "tiff.h"
# include "tiffio.h"
#endif
namespace cv
{
static const char fmtSignTiffII[] = "II\x2a\x00";
@@ -55,9 +62,6 @@ static const char fmtSignTiffMM[] = "MM\x00\x2a";
#ifdef HAVE_TIFF
#include "tiff.h"
#include "tiffio.h"
static int grfmt_tiff_err_handler_init = 0;
static void GrFmtSilentTIFFErrorHandler( const char*, const char*, va_list ) {}

View File

@@ -604,7 +604,12 @@ void ColorGradient::write(FileStorage& fs) const
static void accumBilateral(long delta, long i, long j, long * A, long * b, int threshold)
{
long f = std::abs(delta) < threshold ? 1 : 0;
#ifdef __QNX__
long absdelta = (delta > 0) ? delta : -delta;
long f = absdelta < threshold ? 1 : 0;
#else
long f = std::abs(delta) < threshold ? 1 : 0;
#endif
const long fi = f * i;
const long fj = f * j;

View File

@@ -60,6 +60,8 @@
#else
#include <unistd.h>
#include <signal.h>
#include <setjmp.h>
#endif
namespace cvtest
@@ -110,9 +112,6 @@ static void SEHTranslator( unsigned int /*u*/, EXCEPTION_POINTERS* pExp )
#else
#include <signal.h>
#include <setjmp.h>
static const int tsSigId[] = { SIGSEGV, SIGBUS, SIGFPE, SIGILL, SIGABRT, -1 };
static jmp_buf tsJmpMark;