Skip to content

Commit acce2de

Browse files
committed
Revert "ts: expand arguments before stringifications in CV_ENUM and CV_FLAGS"
This reverts commit 19538ca. This wasn't a great idea after all. There is a lot of flags implemented as #define, that we don't want to expand.
1 parent 0016bfe commit acce2de

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

modules/ts/include/opencv2/ts/ts_perf.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ class MatType
9393
* CV_ENUM and CV_FLAGS - macro to create printable wrappers for defines and enums *
9494
\*****************************************************************************************/
9595

96-
// helper macros to force expansion of macro arguments before stringification
97-
// "#" normally blocks argument expansion
98-
#define CV_STRINGIFY_ARGS(...) CV_STRINGIFY_ARGS_(__VA_ARGS__)
99-
#define CV_STRINGIFY_ARGS_(...) #__VA_ARGS__
100-
10196
#define CV_ENUM(class_name, ...) \
10297
namespace { \
10398
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
@@ -106,7 +101,7 @@ class MatType
106101
operator int() const { return val_; } \
107102
void PrintTo(std::ostream* os) const { \
108103
const int vals[] = { __VA_ARGS__ }; \
109-
const char* svals = CV_STRINGIFY_ARGS(__VA_ARGS__); \
104+
const char* svals = #__VA_ARGS__; \
110105
for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) { \
111106
while(isspace(svals[pos]) || svals[pos] == ',') ++pos; \
112107
int start = pos; \
@@ -135,7 +130,7 @@ class MatType
135130
void PrintTo(std::ostream* os) const { \
136131
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
137132
const int vals[] = { __VA_ARGS__ }; \
138-
const char* svals = CV_STRINGIFY_ARGS(__VA_ARGS__); \
133+
const char* svals = #__VA_ARGS__; \
139134
int value = val_; \
140135
bool first = true; \
141136
for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) { \

0 commit comments

Comments
 (0)