Skip to content

Commit eb99617

Browse files
committed
feature2d: fix expansion problems with CV_ENUM in perf
* expand arguments before passing them to CV_ENUM. This does not need modifications of CV_ENUM. * added include guards to `perf_feature2d.hpp`
1 parent acce2de commit eb99617

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/features2d/perf/perf_feature2d.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef __OPENCV_PERF_FEATURE2D_HPP__
2+
#define __OPENCV_PERF_FEATURE2D_HPP__
3+
14
#include "perf_precomp.hpp"
25

36
/* cofiguration for tests of detectors/descriptors. shared between ocl and cpu tests. */
@@ -22,8 +25,10 @@ using std::tr1::get;
2225
BRISK_DEFAULT, \
2326
KAZE_DEFAULT
2427

28+
#define CV_ENUM_EXPAND(name, ...) CV_ENUM(name, __VA_ARGS__)
29+
2530
enum Feature2DVals { DETECTORS_ONLY, DETECTORS_EXTRACTORS };
26-
CV_ENUM(Feature2DType, DETECTORS_ONLY, DETECTORS_EXTRACTORS)
31+
CV_ENUM_EXPAND(Feature2DType, DETECTORS_ONLY, DETECTORS_EXTRACTORS)
2732

2833
typedef std::tr1::tuple<Feature2DType, string> Feature2DType_String_t;
2934
typedef perf::TestBaseWithParam<Feature2DType_String_t> feature2d;
@@ -77,3 +82,5 @@ static inline Ptr<Feature2D> getFeature2D(Feature2DType type)
7782
return Ptr<Feature2D>();
7883
}
7984
}
85+
86+
#endif // __OPENCV_PERF_FEATURE2D_HPP__

0 commit comments

Comments
 (0)