title: Printing name and value of a macro
body: <p>I have a C program with a lot of optimizations that can be enabled or disabled with <code>#define</code>s. When I run my program, I would like to know what macros have been defined at compile time.</p>
  
  <p>So I am trying to write a macro function to print the actual value of a macro. Something like this:</p>
  
  <pre><code>SHOW_DEFINE(X){\
    if( IS_DEFINED(X) )\
        printf("%s is defined and as the value %d\n", #X, (int)X);\
    else\
        printf("%s is not defined\n", #X);\
  }
  </code></pre>
  
  <p>However I don't know how to make it work and I suspect it is not possible, does anyone has an idea of how to do it? </p>
  
  <p>(Note that this must compile even when the macro is not defined!)</p>