From e4b201be25ff92e930b979098e94a89368677313 Mon Sep 17 00:00:00 2001
From: kocheganovvm <kocheganovvm@kocheganovvm-System-Product-Name.(none)>
Date: Tue, 6 Aug 2013 10:38:04 +0400
Subject: [PATCH] Fix unsequenced modifications (Bug #3179).

---
 modules/ts/include/opencv2/ts/ts_perf.hpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp
index 1e68cd49b..fa88dadb8 100644
--- a/modules/ts/include/opencv2/ts/ts_perf.hpp
+++ b/modules/ts/include/opencv2/ts/ts_perf.hpp
@@ -475,9 +475,16 @@ CV_EXPORTS void PrintTo(const Size& sz, ::std::ostream* os);
     INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\
     void fixture##_##name::PerfTestBody()
 
+#if defined(_MSC_VER) && (_MSC_VER <= 1400)
+#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...)	\
+    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
+#else
+#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...)	\
+    __VA_ARGS__;
+#endif
 
-#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
-    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
+#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...)	\
+    CV_PERF_TEST_MAIN_INTERNALS_ARGS(__VA_ARGS__) \
     ::perf::Regression::Init(#modulename);\
     ::perf::TestBase::Init(std::vector<std::string>(impls, impls + sizeof impls / sizeof *impls),\
                            argc, argv);\