testsppcomplete.c 506 B

12345678910111213141516171819202122232425262728293031
  1. /* Example provided by Hannes Janetzek */
  2. struct Test { int test; };
  3. #define BLA(_type) \
  4. _type *bla = (_type*) malloc(sizeof(_type));
  5. #define BLUB(_type) \
  6. (_type*)malloc(sizeof(_type));
  7. #define FOO(_type) \
  8. _type *foo = BLUB(_type);
  9. #define BAR(_type) \
  10. _type *bar = (*_type)BLUB(_type);
  11. int main(int argc, char *argv[]) {
  12. BLA(Test);
  13. bla->// -1-
  14. ; // #1# ( "test" )
  15. FOO(Test);
  16. foo->// -2-
  17. ; // #2# ( "test" )
  18. BAR(Test);
  19. bar->// -3-
  20. ; // #3# ( "test" )
  21. }