fork(1) download
  1. #include <stdio.h>
  2.  
  3. #define DEBUG 1
  4. #define MYDEF 1
  5. //#define YOURDEF 1
  6.  
  7. #define TRACE(x) do { if (DEBUG) printf x; } while (0)
  8.  
  9. #ifdef MYDEF
  10.  
  11. #define IF_MY(x,y) x y
  12.  
  13. #else
  14.  
  15. #define IF_MY(x,y) x
  16.  
  17. #endif
  18.  
  19. #ifdef YOURDEF
  20.  
  21. #define IF_MY_YOUR(x,y,z) IF_MY(x,y) z
  22.  
  23. #else
  24.  
  25. #define IF_MY_YOUR(x,y,z) IF_MY(x,y)
  26.  
  27. #endif
  28.  
  29. int main(void) {
  30. char *msg="aaa";
  31. TRACE((IF_MY_YOUR("Message: %s", " Additional stuff ", " More stuff ")"\n", msg));
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
Message: aaa Additional stuff