From 7267d518d5d6979bd33cdd6dd7fda1075f6017e0 Mon Sep 17 00:00:00 2001
From: Andrey Kamaev <andrey.kamaev@itseez.com>
Date: Thu, 1 Nov 2012 00:48:00 +0400
Subject: [PATCH] Fix build in Visual Studio 2005

---
 modules/ts/include/opencv2/ts/ts_perf.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp
index 3b75ee9ee..0af671808 100644
--- a/modules/ts/include/opencv2/ts/ts_perf.hpp
+++ b/modules/ts/include/opencv2/ts/ts_perf.hpp
@@ -478,7 +478,7 @@ CV_EXPORTS void PrintTo(const Size& sz, ::std::ostream* os);
 #define CV_PERF_TEST_MAIN(testsuitname, ...) \
 int main(int argc, char **argv)\
 {\
-    __VA_ARGS__;\
+    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
     ::perf::Regression::Init(#testsuitname);\
     ::perf::TestBase::Init(argc, argv);\
     ::testing::InitGoogleTest(&argc, argv);\