Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-03-06 19:40:34 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2014-03-06 19:56:46 +0400
commit8e5247203720de7abd084996c00afd6fb6f6cc21 (patch)
tree9c1f8d20f20ba543d20afb884b0c0856a16747ea /tests
parent4a759bfbcfbf4a5e8e0c734687578ffe34d2ca87 (diff)
tests: MSVC compat
MSVC doesn't like declaring variables in the middle of a block, so make sure we only declare variables at the beginning of a block.
Diffstat (limited to 'tests')
-rw-r--r--tests/structinit/structinit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/structinit/structinit.c b/tests/structinit/structinit.c
index db7ee07fa..ce425be41 100644
--- a/tests/structinit/structinit.c
+++ b/tests/structinit/structinit.c
@@ -19,8 +19,10 @@
* signature "int (structname* instance, int version)".
*/
#define CHECK_MACRO_FUNC_INIT_EQUAL(structname, structver, macroinit, funcinitname) \
+do { \
structname structname##_macro_latest = macroinit; \
structname structname##_func_latest; \
+ int structname##_curr_ver = structver - 1; \
cl_git_pass(funcinitname(&structname##_func_latest, structver)); \
cl_check_( \
memcmp(&structname##_macro_latest, &structname##_func_latest, \
@@ -28,13 +30,13 @@
"Macro-based and function-based initializer for " STRINGIFY(structname) \
" are not equivalent."); \
\
- int structname##_curr_ver = structver - 1; \
while (structname##_curr_ver > 0) \
{ \
structname macro; \
cl_git_pass(funcinitname(&macro, structname##_curr_ver)); \
structname##_curr_ver--; \
- }
+ }\
+} while(0)
void test_structinit_structinit__compare(void)
{