From d3a15c625addca94de97ccad224e5446e0c6be7e Mon Sep 17 00:00:00 2001 From: chacha21 Date: Fri, 10 Feb 2017 21:58:02 +0100 Subject: [PATCH 1/4] do not use GCC_VERSION --- modules/imgproc/src/drawing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index 1dd436a514..9bef7ba85d 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -1107,7 +1107,7 @@ static inline uint32_t opencvBigToHost32(const uchar* p){ uint32_t x; memcpy(&x,p,4); return x; -#elif OPENCV_BYTEORDER==1234 && defined(__GNUC__) && GCC_VERSION>=4003000 +#elif OPENCV_BYTEORDER==1234 && defined(__GNUC__) uint32_t x; memcpy(&x,p,4); return __builtin_bswap32(x); @@ -1133,7 +1133,7 @@ static inline uint32_t opencvLittleToHost32(const uchar* p){ uint32_t x; memcpy(&x,p,4); return x; -#elif OPENCV_BYTEORDER==4321 && defined(__GNUC__) && GCC_VERSION>=4003000 +#elif OPENCV_BYTEORDER==4321 && defined(__GNUC__) uint32_t x; memcpy(&x,p,4); return __builtin_bswap32(x); From 7521bcc32c9750b7c73800fc7c9d32e7c5db9646 Mon Sep 17 00:00:00 2001 From: chacha21 Date: Fri, 10 Feb 2017 22:34:44 +0100 Subject: [PATCH 2/4] comment unused function On MacOS and iOS, the unused opencvBigToHost32 is a warning for buildbot --- modules/imgproc/src/drawing.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index 9bef7ba85d..a3002b0c6a 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -1102,6 +1102,7 @@ static const int opencvOne = 1; # endif # endif +/* static inline uint32_t opencvBigToHost32(const uchar* p){ #if OPENCV_BYTEORDER==4321 uint32_t x; @@ -1127,6 +1128,7 @@ static inline uint32_t opencvBigToHost32(uint32_t x){ return opencvBigToHost32((uchar*)&x); #endif } +*/ static inline uint32_t opencvLittleToHost32(const uchar* p){ #if OPENCV_BYTEORDER==1234 From e19000a56f5b03dee1f412d8b25711307ea0be00 Mon Sep 17 00:00:00 2001 From: chacha21 Date: Sat, 11 Feb 2017 11:07:00 +0100 Subject: [PATCH 3/4] adaptation for iOS buildbot --- modules/imgproc/src/drawing.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index a3002b0c6a..42e4a551ff 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -1086,6 +1086,7 @@ EllipseEx( Mat& img, Point2l center, Size2l axes, #endif #if !defined(OPENCV_BYTEORDER) +# define OPENCV_BYTEORDER 0 static const int opencvOne = 1; # define OPENCV_BIGENDIAN (*(char *)(&opencvOne)==0) # define OPENCV_LITTLEENDIAN (*(char *)(&opencvOne)==1) @@ -1143,13 +1144,15 @@ static inline uint32_t opencvLittleToHost32(const uchar* p){ uint32_t x; memcpy(&x,p,4); return _byteswap_ulong(x); +#elif OPENCV_LITTLEENDIAN + return x; #else return ((unsigned)p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]; #endif } static inline uint32_t opencvLittleToHost32(uint32_t x){ -#if OPENCV_BYTEORDER==1234 +#if OPENCV_LITTLEENDIAN return x; #else return opencvLittleToHost32((uchar*)&x); From 16a9407fbf5f9a7c30a7fb7322aaa6eb0001664b Mon Sep 17 00:00:00 2001 From: chacha21 Date: Sat, 11 Feb 2017 11:26:55 +0100 Subject: [PATCH 4/4] new try to adapt to iOS build bot --- modules/imgproc/src/drawing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index 42e4a551ff..9632c77746 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -1075,7 +1075,7 @@ EllipseEx( Mat& img, Point2l center, Size2l axes, #if (defined(i386) || defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ - defined(__arm__)) + defined(__arm__) || defined(__aarch64__)) # define OPENCV_BYTEORDER 1234 # define OPENCV_BIGENDIAN 0 # define OPENCV_LITTLEENDIAN 1