Fix non support of break in M_LET_IF
This commit is contained in:
1 parent
01167b09c4
commit
4dbcfd25b3
2 files changed
+15
-2
No files matched your search
@@ -3135,7 +3135,7 @@ m_core_parse2_enum (const char str[], const char **endptr)
|
||||
|
||||
#define M_DEFER_INTERNAL(clear, cont) \
|
||||
for(bool cont = true; cont; cont = false) \
|
||||
for( (void) 0; cont ; (clear)) \
|
||||
for( (void) 0; cont ; (clear), cont = false) \
|
||||
for( (void) 0; cont; cont = false) \
|
||||
|
||||
|
||||
@@ -3157,7 +3157,7 @@ m_core_parse2_enum (const char str[], const char **endptr)
|
||||
|
||||
#define M_LET_IF_INTERNAL(init, test, clear, else_a, cont) \
|
||||
for(bool cont = true; cont; cont = false) \
|
||||
for( init ; cont && ( (test) || (else_a, false) ); (clear)) \
|
||||
for( init ; cont && ( (test) || (else_a, false) ); (clear), cont = false) \
|
||||
for( (void) 0; cont; cont = false) \
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +214,13 @@ static void test_let(void)
|
||||
}
|
||||
assert(c++ == 14);
|
||||
|
||||
M_LET_IF( assert(c++ == 15), (assert(c++ == 16), true), assert(c++ == 18) ) {
|
||||
assert(c++ == 17);
|
||||
break;
|
||||
assert(0);
|
||||
}
|
||||
assert(c++ == 19);
|
||||
|
||||
c = 7;
|
||||
int *p = (int*)malloc(sizeof(int));
|
||||
assert(p != NULL);
|
||||
@@ -222,6 +229,12 @@ static void test_let(void)
|
||||
assert(c++ == 7);
|
||||
}
|
||||
assert(c++ == 9);
|
||||
M_DEFER ( assert(c++ == 11) ) {
|
||||
assert(c++ == 10);
|
||||
break;
|
||||
assert(0);
|
||||
}
|
||||
assert(c++ == 12);
|
||||
}
|
||||
|
||||
static void test_va(void)
|
||||
|
||||
Reference in new issue
Block a user