File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
include/opencv2/core/utils Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -82,16 +82,24 @@ option(OPENCV_ENABLE_ALLOCATOR_STATS "Enable Allocator metrics" ON)
82
82
83
83
if (NOT OPENCV_ENABLE_ALLOCATOR_STATS )
84
84
add_definitions (-DOPENCV_DISABLE_ALLOCATOR_STATS=1 )
85
- else ( )
85
+ elseif ( HAVE_CXX11 OR DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE )
86
86
if (NOT DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE )
87
87
if (HAVE_ATOMIC_LONG_LONG AND OPENCV_ENABLE_ATOMIC_LONG_LONG )
88
- set (OPENCV_ALLOCATOR_STATS_COUNTER_TYPE "long long" )
88
+ if (MINGW )
89
+ # command-line generation issue due to space in value, int/int64_t should be used instead
90
+ # https://github.com/opencv/opencv/issues/16990
91
+ message (STATUS "Consider adding OPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int/int64_t according to your build configuration" )
92
+ else ()
93
+ set (OPENCV_ALLOCATOR_STATS_COUNTER_TYPE "long long" )
94
+ endif ()
89
95
else ()
90
96
set (OPENCV_ALLOCATOR_STATS_COUNTER_TYPE "int" )
91
97
endif ()
92
98
endif ()
93
- message (STATUS "Allocator metrics storage type: '${OPENCV_ALLOCATOR_STATS_COUNTER_TYPE} '" )
94
- add_definitions ("-DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=${OPENCV_ALLOCATOR_STATS_COUNTER_TYPE} " )
99
+ if (DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE )
100
+ message (STATUS "Allocator metrics storage type: '${OPENCV_ALLOCATOR_STATS_COUNTER_TYPE} '" )
101
+ add_definitions ("-DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=${OPENCV_ALLOCATOR_STATS_COUNTER_TYPE} " )
102
+ endif ()
95
103
endif ()
96
104
97
105
Original file line number Diff line number Diff line change 7
7
8
8
#include " ./allocator_stats.hpp"
9
9
10
- #ifdef CV_CXX11
11
- #include < atomic>
12
- #endif
13
-
14
10
// #define OPENCV_DISABLE_ALLOCATOR_STATS
15
11
16
- namespace cv { namespace utils {
12
+ #ifdef CV_CXX11
13
+
14
+ #include < atomic>
17
15
18
16
#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE
19
17
#if defined(__GNUC__) && (\
@@ -28,6 +26,16 @@ namespace cv { namespace utils {
28
26
#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE long long
29
27
#endif
30
28
29
+ #else // CV_CXX11
30
+
31
+ #ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE
32
+ #define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int // CV_XADD supports int only
33
+ #endif
34
+
35
+ #endif // CV_CXX11
36
+
37
+ namespace cv { namespace utils {
38
+
31
39
#ifdef CV__ALLOCATOR_STATS_LOG
32
40
namespace {
33
41
#endif
You can’t perform that action at this time.
0 commit comments