Skip to contentSkip to conversation

opencv: backport patch "Fix sign() macro redefinition compile-time error"

PATCH New Denys Dmytriyenko 1 participant 1 message Feb 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opencv: backport patch "Fix sign() macro redefinition compile-time error"

---
 ...ign-macro-redefinition-compile-time-error.patch | 39 ++++++++++++++++++++++
 .../recipes-support/opencv/opencv_3.1.bb           |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta-arago-extras/recipes-support/opencv/opencv/0001-Fix-sign-macro-redefinition-compile-time-error.patch
meta-arago-extras/recipes-support/opencv/opencv/0001-Fix-sign-macro-redefinition-compile-time-error.patch new file +39 -0
new file mode 100644
index 0000000..481bccb
@@ -0,0 +1,39 @@
+From 395db9e7211d58473beafa6a9643d3cd49ad4eb4 Mon Sep 17 00:00:00 2001
+From: Gregory Kramida <[email protected]>
+Date: Mon, 23 May 2016 12:56:39 -0400
+Subject: [PATCH] Fix sign() macro redefinition compile-time error
+
+---
+ modules/tracking/include/opencv2/tracking/onlineMIL.hpp | 2 --
+ modules/tracking/src/onlineMIL.cpp                      | 2 ++
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/tracking/include/opencv2/tracking/onlineMIL.hpp b/modules/tracking/include/opencv2/tracking/onlineMIL.hpp
+index b6fc25b..78e1372 100644
+--- a/modules/tracking/include/opencv2/tracking/onlineMIL.hpp
++++ b/modules/tracking/include/opencv2/tracking/onlineMIL.hpp
+@@ -54,8 +54,6 @@ namespace cv
+ //TODO based on the original implementation
+ //http://vision.ucsd.edu/~bbabenko/project_miltrack.shtml
+ 
+-#define  sign(s)  ((s > 0 ) ? 1 : ((s<0) ? -1 : 0))
+-
+ class ClfOnlineStump;
+ 
+ class CV_EXPORTS ClfMilBoost
+diff --git a/modules/tracking/src/onlineMIL.cpp b/modules/tracking/src/onlineMIL.cpp
+index 4fcfb54..29fa9fe 100644
+--- a/modules/tracking/src/onlineMIL.cpp
++++ b/modules/tracking/src/onlineMIL.cpp
+@@ -42,6 +42,8 @@
+ #include "precomp.hpp"
+ #include "opencv2/tracking/onlineMIL.hpp"
+ 
++#define  sign(s)  ((s > 0 ) ? 1 : ((s<0) ? -1 : 0))
++
+ template<class T> class SortableElementRev
+ {
+  public:
+-- 
+2.7.4
+
meta-arago-extras/recipes-support/opencv/opencv_3.1.bb +1 -0
index 168eeff..acc9d71 100644
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
     file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
     file://fixgcc60.patch \
     file://fixpkgconfig.patch \
+    file://0001-Fix-sign-macro-redefinition-compile-time-error.patch;patchdir=../contrib \
 "
 
 PV = "3.1+git${SRCPV}"
Signature · 1 line
2.7.4