title: Mathematical operations during compiler preprocessing
body: <p>I often have the situation where I need several constants generated at compile time for the use of bit shift and masking operations.</p>
  
  <p>e.g.</p>
  
  <pre><code>#define blockbits 8
  #define blocksize 256   // could be generated from 2^blockbits
  #define blocksize 0xFF  // could be generated from blocksize - 1
  </code></pre>
  
  <p>I would like all these to be generated from <code>blockbits</code>, however there is no power operation that can be used in the preprocessor that I am aware of. </p>
  
  <p>Does anyone know a simple way of generating this sort of thing at compile time?</p>