title: Using typeof to convert a variable declaration to a type?
body: <p>Currently, I have a scenario much like this:</p>
  
  <pre><code>#define my_macro(var) __builtin_types_compatible_p(typeof(var), foo) ? do_something : do_something_else
  </code></pre>
  
  <p>However, inadvertently the macro gets passed this parameter:</p>
  
  <pre><code>my_macro(int x);
  </code></pre>
  
  <p>Which of course fails, because <code>typeof(int x)</code> isn't valid.</p>
  
  <p>Is there a transformation I can apply inside the <code>my_macro</code> which will allow <code>typeof</code> to work on that expression? I cannot change what is passed into the macro, only what happens inside the macro.</p>
  
  <p>So, something like this:</p>
  
  <pre><code>#define my_macro(var) typeof(?? var ??)
  </code></pre>
  
  <p>Or, is there another expression I should be using here?</p>