104494
|
1 /* Example provided by Hannes Janetzek */
|
|
2
|
|
3 struct Test { int test; };
|
|
4
|
|
5 #define BLA(_type) \
|
|
6 _type *bla = (_type*) malloc(sizeof(_type));
|
|
7
|
|
8 #define BLUB(_type) \
|
|
9 (_type*)malloc(sizeof(_type));
|
|
10
|
|
11 #define FOO(_type) \
|
|
12 _type *foo = BLUB(_type);
|
|
13
|
|
14 #define BAR(_type) \
|
|
15 _type *bar = (*_type)BLUB(_type);
|
|
16
|
|
17 int main(int argc, char *argv[]) {
|
|
18 BLA(Test);
|
|
19 bla->// -1-
|
|
20 ; // #1# ( "test" )
|
|
21
|
|
22 FOO(Test);
|
|
23 foo->// -2-
|
|
24 ; // #2# ( "test" )
|
|
25
|
|
26 BAR(Test);
|
|
27 bar->// -3-
|
|
28 ; // #3# ( "test" )
|
|
29 }
|
105377
|
30
|
|
31 /* arch-tag: f4a9fe26-9035-4378-b951-9f06d6554599
|
|
32 (do not change this comment) */
|