deepin-ocr/3rdparty/opencv-mobile/opencv-2.4.13.7-unsafe-xadd.patch
wangzhengyang 718c41634f feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
2022-05-10 10:22:11 +08:00

53 lines
2.0 KiB
Diff

diff -Nuarp opencv-2.4.13.7/modules/core/include/opencv2/core/operations.hpp opencv-2.4.13.7.unsafe_xadd/modules/core/include/opencv2/core/operations.hpp
--- opencv-2.4.13.7/modules/core/include/opencv2/core/operations.hpp 2018-07-02 05:41:56.000000000 +0800
+++ opencv-2.4.13.7.unsafe_xadd/modules/core/include/opencv2/core/operations.hpp 2021-05-11 15:43:01.953963662 +0800
@@ -52,46 +52,8 @@
#ifdef __cplusplus
/////// exchange-add operation for atomic operations on reference counters ///////
-#ifdef CV_XADD
- // allow to use user-defined macro
-#elif defined __GNUC__
-
- #if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)
- #ifdef __ATOMIC_SEQ_CST
- #define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST)
- #else
- #define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), (delta), 5)
- #endif
- #elif __GNUC__*10 + __GNUC_MINOR__ >= 42
-
- #if !(defined WIN32 || defined _WIN32) && (defined __i486__ || defined __i586__ || \
- defined __i686__ || defined __MMX__ || defined __SSE__ || defined __ppc__) || \
- defined _STLPORT_MAJOR || defined _LIBCPP_VERSION || \
- defined __EMSCRIPTEN__
-
- #define CV_XADD __sync_fetch_and_add
- #else
- #include <ext/atomicity.h>
- #define CV_XADD __gnu_cxx::__exchange_and_add
- #endif
-
- #else
- #include <bits/atomicity.h>
- #if __GNUC__*10 + __GNUC_MINOR__ >= 34
- #define CV_XADD __gnu_cxx::__exchange_and_add
- #else
- #define CV_XADD __exchange_and_add
- #endif
- #endif
-
-#elif defined WIN32 || defined _WIN32 || defined WINCE
- namespace cv { CV_EXPORTS int _interlockedExchangeAdd(int* addr, int delta); }
- #define CV_XADD cv::_interlockedExchangeAdd
-
-#else
- static inline int CV_XADD(int* addr, int delta)
- { int tmp = *addr; *addr += delta; return tmp; }
-#endif
+static inline int CV_XADD(int* addr, int delta)
+{ int tmp = *addr; *addr += delta; return tmp; }
#include <limits>