mirror of
https://github.com/nihui/opencv-mobile.git
synced 2025-11-03 02:33:31 +08:00
drawing mono font, ci matrix release, source package (#76)
This commit is contained in:
38
patches/opencv-3.4.20-unsafe-xadd.patch
Normal file
38
patches/opencv-3.4.20-unsafe-xadd.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/include/opencv2/core/cvdef.h opencv-3.4.20/modules/core/include/opencv2/core/cvdef.h
|
||||
--- opencv-3.4.20.orig/modules/core/include/opencv2/core/cvdef.h 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/include/opencv2/core/cvdef.h 2023-08-06 11:12:38.619404492 +0800
|
||||
@@ -534,33 +534,7 @@ Cv64suf;
|
||||
* exchange-add operation for atomic operations on reference counters *
|
||||
\****************************************************************************************/
|
||||
|
||||
-#ifdef CV_XADD
|
||||
- // allow to use user-defined macro
|
||||
-#elif defined __GNUC__ || defined __clang__
|
||||
-# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) && !defined __INTEL_COMPILER
|
||||
-# ifdef __ATOMIC_ACQ_REL
|
||||
-# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
|
||||
-# else
|
||||
-# define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4)
|
||||
-# endif
|
||||
-# else
|
||||
-# if defined __ATOMIC_ACQ_REL && !defined __clang__
|
||||
- // version for gcc >= 4.7
|
||||
-# define CV_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)
|
||||
-# else
|
||||
-# define CV_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta))
|
||||
-# endif
|
||||
-# endif
|
||||
-#elif defined _MSC_VER && !defined RC_INVOKED
|
||||
-# include <intrin.h>
|
||||
-# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)
|
||||
-#else
|
||||
- #ifdef OPENCV_FORCE_UNSAFE_XADD
|
||||
- CV_INLINE int CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }
|
||||
- #else
|
||||
- #error "OpenCV: can't define safe CV_XADD macro for current platform (unsupported). Define CV_XADD macro through custom port header (see OPENCV_INCLUDE_PORT_FILE)"
|
||||
- #endif
|
||||
-#endif
|
||||
+CV_INLINE int CV_XADD(void* addr, int delta) { int tmp = *(int*)addr; *(int*)addr += delta; return tmp; }
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
Reference in New Issue
Block a user