title: C++ #define variable parameter function
body: <p>I have a CPU sensitive application and want to minimize function calls. I want to write something like:      </p>
  
  <pre><code>#ifdef condition        
  #define f(a,b) ff(a,b)   
  #define f(a) ff(a)    
  #endif    
  </code></pre>
  
  <p>But the compiler sees f as defined multiple times. I wanted to use <code>__VAR_ARGS__</code> but in the example above <code>b</code> is of <code>enum</code> type. Is there a proper way to do it or I should just rename <code>f(a,b)</code>  to <code>f2(a,b)</code>?</p>
  
  <p>To clarify the defines, if active, add calls to functions that process data for printing to file/stdout, otherwise they are replaced with empty lines, so in my opinion this method would improve code size and since the macro is single line keyword like <code>INFO(object-&gt;contents)</code> I think it's more readable. Also it would have been useful if I could have added something like <code>WARN("message")</code> and <code>WARN("value is",obj-&gt;printvalue())</code>. </p>
  
  <p>I also think <code>inline</code> would do the trick (from the answer below).</p>