title: How to use #if inside #define in the C preprocessor?
body: <p>I want to write a macro that spits out code based on the boolean value of its parameter. So say <code>DEF_CONST(true)</code> should be expanded into <code>const</code>, and <code>DEF_CONST(false)</code> should be expanded into nothing.</p>
  
  <p>Clearly the following doesn't work because we can't use another preprocessor inside #defines:</p>
  
  <pre><code>#define DEF_CONST(b_const) \
  #if (b_const) \
    const \
  #endif
  </code></pre>