Add patches required for SunOS support.

This commit is contained in:
jperkin 2013-06-12 10:13:58 +00:00
parent ba87244e93
commit 05d0512edd
4 changed files with 101 additions and 1 deletions

View file

@ -1,10 +1,13 @@
$NetBSD: distinfo,v 1.19 2013/05/06 14:48:22 joerg Exp $
$NetBSD: distinfo,v 1.20 2013/06/12 10:13:58 jperkin Exp $
SHA1 (OpenCV-2.4.3.tar.bz2) = 982be2c3e52dfc3e9d14692c60bc856b2b766be2
RMD160 (OpenCV-2.4.3.tar.bz2) = b862ddd9e7fefd885d78835660a9f5c9320889c2
Size (OpenCV-2.4.3.tar.bz2) = 67240491 bytes
SHA1 (patch-modules_contrib_src_inputoutput.cpp) = dc3413182c94b670823d509ab38f21ce36d4f432
SHA1 (patch-modules_contrib_src_spinimages.cpp) = b3e465700059616be991d597230bc8dc42f15be1
SHA1 (patch-modules_core_include_opencv2_core_types_c.h) = c056068c01c417dc262f21c00324da7f86c0cd8e
SHA1 (patch-modules_core_src_system.cpp) = 3b7ac545585a430d28c7077f360357079f127580
SHA1 (patch-modules_flann_include_opencv2_flann_defines.h) = ab848e67c4e03219670598ac2d21071a617a5c33
SHA1 (patch-modules_legacy_src_dpstereo.cpp) = da9955fb6cc81054427b69efb97a58160b64f262
SHA1 (patch-modules_ts_include_opencv2_ts_ts__perf.hpp) = 8a7f08b176cedec85fd613e715d7b12d666a3e45
SHA1 (patch-modules_ts_src_ts.cpp) = c30482215db80285aa7a5ad039308cbfca033672

View file

@ -0,0 +1,66 @@
$NetBSD: patch-modules_contrib_src_inputoutput.cpp,v 1.1 2013/06/12 10:13:58 jperkin Exp $
SunOS does not have dirent d_type.
--- modules/contrib/src/inputoutput.cpp.orig 2012-10-17 22:55:38.000000000 +0000
+++ modules/contrib/src/inputoutput.cpp
@@ -5,6 +5,9 @@
#include <windows.h>
#include <tchar.h>
#else
+#ifdef __sun
+ #include <sys/stat.h>
+#endif
#include <dirent.h>
#endif
@@ -47,6 +50,10 @@ namespace cv
(void)addPath;
DIR *dp;
struct dirent *dirp;
+#ifdef __sun
+ struct stat sb;
+ char buf[PATH_MAX];
+#endif
if((dp = opendir(path.c_str())) == NULL)
{
return list;
@@ -54,7 +61,13 @@ namespace cv
while ((dirp = readdir(dp)) != NULL)
{
+#ifdef __sun
+ snprintf(buf, PATH_MAX, "%s/%s", path.c_str(), dirp->d_name);
+ stat(buf, &sb);
+ if (S_ISREG(sb.st_mode))
+#else
if (dirp->d_type == DT_REG)
+#endif
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
@@ -105,6 +118,10 @@ namespace cv
(void)addPath;
DIR *dp;
struct dirent *dirp;
+#ifdef __sun
+ struct stat sb;
+ char buf[PATH_MAX];
+#endif
if((dp = opendir(path_f.c_str())) == NULL)
{
return list;
@@ -112,7 +129,13 @@ namespace cv
while ((dirp = readdir(dp)) != NULL)
{
+#ifdef __sun
+ snprintf(buf, PATH_MAX, "%s/%s", path.c_str(), dirp->d_name);
+ stat(buf, &sb);
+ if (S_ISDIR(sb.st_mode) &&
+#else
if (dirp->d_type == DT_DIR &&
+#endif
strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0 )
{

View file

@ -0,0 +1,16 @@
$NetBSD: patch-modules_flann_include_opencv2_flann_defines.h,v 1.1 2013/06/12 10:13:58 jperkin Exp $
Avoid CS conflict on SunOS.
--- modules/flann/include/opencv2/flann/defines.h.orig 2012-09-27 22:55:06.000000000 +0000
+++ modules/flann/include/opencv2/flann/defines.h
@@ -71,6 +71,9 @@
#define FLANN_PLATFORM_32_BIT
#endif
+#ifdef __sun
+#undef CS
+#endif
#undef FLANN_ARRAY_LEN
#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))

View file

@ -0,0 +1,15 @@
$NetBSD: patch-modules_ts_src_ts.cpp,v 1.1 2013/06/12 10:13:58 jperkin Exp $
Avoid std::string conflict.
--- modules/ts/src/ts.cpp.orig 2012-07-25 22:55:31.000000000 +0000
+++ modules/ts/src/ts.cpp
@@ -557,7 +557,7 @@ void TS::vprintf( int streams, const cha
for( int i = 0; i < MAX_IDX; i++ )
if( (streams & (1 << i)) )
{
- output_buf[i] += std::string(str);
+ output_buf[i] += ::std::string(str);
// in the new GTest-based framework we do not use
// any output files (except for the automatically generated xml report).
// if a test fails, all the buffers are printed, so we do not want to duplicate the information and