title: How to make a preprocessor macro greedy?
body: <p>We have the following preprocessor macro. Its used to help with Doxygen documentation because Doxygen has troubles with C++ and some template typedefs:</p>
  
  <pre class="lang-none prettyprint-override"><code>#if defined(DOXYGEN_PROCESSING)
  # define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
  #else
  # define DOCUMENTED_TYPEDEF(x, y) typedef x y;
  #endif
  </code></pre>
  
  <p>It works great when <code>X</code> is a non-template or has only one template parameter. However, if <code>X</code> is a template with multiple parameters:</p>
  
  <pre class="lang-none prettyprint-override"><code>DOCUMENTED_TYPEDEF(Foo&lt;R,S&gt;,Bar);
  </code></pre>
  
  <p>Then it results in compile errors because the string is split into <code>Foo&lt;R</code> and <code>S&gt;,Bar</code> (and it does not generate the documentation).</p>
  
  <p>How do I make a preprocessor macro greedy?</p>