fix compilation bug
This commit is contained in:
parent
208c0d05bd
commit
eac7322832
109
Fix_compilation_of_copy_assignment_operators_with_GCC.patch
Normal file
109
Fix_compilation_of_copy_assignment_operators_with_GCC.patch
Normal file
@ -0,0 +1,109 @@
|
||||
diff -Npur opencv-4.5.2/modules/core/include/opencv2/core/types.hpp opencv-4.5.2-new/modules/core/include/opencv2/core/types.hpp
|
||||
--- opencv-4.5.2/modules/core/include/opencv2/core/types.hpp 2021-04-02 19:23:54.000000000 +0800
|
||||
+++ opencv-4.5.2-new/modules/core/include/opencv2/core/types.hpp 2021-11-13 16:24:25.592720089 +0800
|
||||
@@ -162,13 +162,23 @@ public:
|
||||
//! default constructor
|
||||
Point_();
|
||||
Point_(_Tp _x, _Tp _y);
|
||||
+#if (defined(__GNUC__) && __GNUC__ < 5)
|
||||
+ Point_(const Point_& pt);
|
||||
+ Point_(Point_&& pt) CV_NOEXCEPT = default;
|
||||
+#elif OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point_(const Point_& pt);
|
||||
Point_(Point_&& pt) CV_NOEXCEPT;
|
||||
+#endif
|
||||
Point_(const Size_<_Tp>& sz);
|
||||
Point_(const Vec<_Tp, 2>& v);
|
||||
|
||||
+#if (defined(__GNUC__) && __GNUC__ < 5) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
||||
+ Point_& operator = (const Point_& pt);
|
||||
+ Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
||||
+#elif OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point_& operator = (const Point_& pt);
|
||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT;
|
||||
+#endif
|
||||
//! conversion to another data type
|
||||
template<typename _Tp2> operator Point_<_Tp2>() const;
|
||||
|
||||
@@ -244,13 +254,17 @@ public:
|
||||
//! default constructor
|
||||
Point3_();
|
||||
Point3_(_Tp _x, _Tp _y, _Tp _z);
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point3_(const Point3_& pt);
|
||||
Point3_(Point3_&& pt) CV_NOEXCEPT;
|
||||
+#endif
|
||||
explicit Point3_(const Point_<_Tp>& pt);
|
||||
Point3_(const Vec<_Tp, 3>& v);
|
||||
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point3_& operator = (const Point3_& pt);
|
||||
Point3_& operator = (Point3_&& pt) CV_NOEXCEPT;
|
||||
+#endif
|
||||
//! conversion to another data type
|
||||
template<typename _Tp2> operator Point3_<_Tp2>() const;
|
||||
//! conversion to cv::Vec<>
|
||||
@@ -320,12 +334,16 @@ public:
|
||||
//! default constructor
|
||||
Size_();
|
||||
Size_(_Tp _width, _Tp _height);
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Size_(const Size_& sz);
|
||||
Size_(Size_&& sz) CV_NOEXCEPT;
|
||||
+#endif
|
||||
Size_(const Point_<_Tp>& pt);
|
||||
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Size_& operator = (const Size_& sz);
|
||||
Size_& operator = (Size_&& sz) CV_NOEXCEPT;
|
||||
+#endif
|
||||
//! the area (width*height)
|
||||
_Tp area() const;
|
||||
//! aspect ratio (width/height)
|
||||
@@ -425,13 +443,17 @@ public:
|
||||
//! default constructor
|
||||
Rect_();
|
||||
Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Rect_(const Rect_& r);
|
||||
Rect_(Rect_&& r) CV_NOEXCEPT;
|
||||
+#endif
|
||||
Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz);
|
||||
Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2);
|
||||
|
||||
+#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Rect_& operator = ( const Rect_& r );
|
||||
Rect_& operator = ( Rect_&& r ) CV_NOEXCEPT;
|
||||
+#endif
|
||||
//! the top-left corner
|
||||
Point_<_Tp> tl() const;
|
||||
//! the bottom-right corner
|
||||
@@ -1164,6 +1186,12 @@ template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(_Tp _x, _Tp _y)
|
||||
: x(_x), y(_y) {}
|
||||
|
||||
+#if (defined(__GNUC__) && __GNUC__ < 5)
|
||||
+template<typename _Tp> inline
|
||||
+Point_<_Tp>::Point_(const Point_& pt)
|
||||
+ : x(pt.x), y(pt.y) {}
|
||||
+#endif
|
||||
+
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(const Point_& pt)
|
||||
: x(pt.x), y(pt.y) {}
|
||||
@@ -1180,6 +1208,15 @@ template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(const Vec<_Tp,2>& v)
|
||||
: x(v[0]), y(v[1]) {}
|
||||
|
||||
+#if (defined(__GNUC__) && __GNUC__ < 5)
|
||||
+template<typename _Tp> inline
|
||||
+Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
|
||||
+{
|
||||
+ x = pt.x; y = pt.y;
|
||||
+ return *this;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
Name: opencv
|
||||
Version: 4.5.2
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: OpenCV means Intel® Open Source Computer Vision Library.
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/opencv/opencv
|
||||
@ -12,6 +12,7 @@ Source4: opencv_extra-4.5.2.tar.gz.ac
|
||||
Source5: opencv_extra-4.5.2.tar.gz.ad
|
||||
Source6: opencv_extra-4.5.2.tar.gz.ae
|
||||
Patch1: Fix-OpenCV-build-with-OpenEXR-before-2.2.0.patch
|
||||
Patch2: Fix_compilation_of_copy_assignment_operators_with_GCC.patch
|
||||
BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf
|
||||
BuildRequires: cmake
|
||||
BuildRequires: libjpeg-devel
|
||||
@ -75,6 +76,9 @@ make install DESTDIR=%{buildroot}
|
||||
%exclude /usr/local/share/*
|
||||
|
||||
%changelog
|
||||
* Wed Nov 13 2021 shenwei <shenwei41@huawei.com> - 4.5.2-3
|
||||
- fix compilation of copy ctors/assignment operators with GCC 4.x
|
||||
|
||||
* Wed Nov 10 2021 yanhailiang <yanhailiang@huawei.com> - 4.5.2-2
|
||||
- bugFix OpenCV build with OpenEXR before 2.2.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user