aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/opencv
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/opencv')
-rw-r--r--graphics/opencv/Makefile6
-rw-r--r--graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp11
2 files changed, 17 insertions, 0 deletions
diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index f5e7ecc192d2..7d6203567997 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -28,6 +28,12 @@ NOT_FOR_ARCHS_REASON_sparc64= does not compile on sparc64
DATADIR= ${PREFIX}/share/OpenCV
PLIST_SUB+= VERSION=${DISTVERSION}
+_COMPVERSION!= ${CC} --version
+.if ${_COMPVERSION:Mclang}
+USE_CXXSTD= gnu++11
+CXXFLAGS+= -Wno-error -Wno-c++11-narrowing
+.endif
+
.if !defined(_BUILDING_OPENCV_CORE) && !defined(_BUILDING_OPENCV_PYTHON)
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-opencv
LIB_DEPENDS+= opencv_core.2:${PORTSDIR}/graphics/opencv-core
diff --git a/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp b/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp
new file mode 100644
index 000000000000..45e93d010363
--- /dev/null
+++ b/graphics/opencv/files/patch-samples_cpp_bagofwords_classification.cpp
@@ -0,0 +1,11 @@
+--- samples/cpp/bagofwords_classification.cpp.orig 2011-09-12 20:20:43.000000000 +0200
++++ samples/cpp/bagofwords_classification.cpp 2013-09-12 14:57:38.068066669 +0200
+@@ -1814,7 +1814,7 @@
+ void VocData::readFileToString(const string filename, string& file_contents)
+ {
+ std::ifstream ifs(filename.c_str());
+- if (ifs == false) CV_Error(CV_StsError,"could not open text file");
++ if (!ifs.is_open()) CV_Error(CV_StsError,"could not open text file");
+
+ stringstream oss;
+ oss << ifs.rdbuf();