language: C (gcc-4.7.2)
date: 317 days 1 hour ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
 
#define FOR(init, condition, increment, body) \
{ \
    init; \
    while (condition) { \
        int entered = 0; \
        int finished = 0; \
        do { \
            if (finished) { \
                goto more; \
            } \
            if (entered) { \
                goto more; \
            } \
            entered = 1; \
            body \
            finished = 1; \
        } while (1); \
        if (!finished) { \
            goto out; \
        } \
    more: \
        increment; \
    } \
out:; \
}
 
int main ()
{
    FOR(int i = 0, i < 10, i++, {
        if (i == 4) continue;
        if (i == 6) break;
        printf("%d\n", i);
    })
    
    return 0;
}