title: Macro and function with same name
body: <p>I have the following code</p>
  
  <pre><code>#define myfunc(a,b) myfunc(do_a(a), do_b(b))
  
  void myfunc(int a, int b)
  {
    do_blah(a,b);
  }
  int main()
  {
      int x = 6, y = 7;
      myfunc(x,y);
  
      return 0;
  }
  </code></pre>
  
  <p>I want the pre-processor to expand function myfunc only at calling. Required  code after pre-processing looks like this:</p>
  
  <pre><code>void myfunc(int a, int b)
  {
    do_blah(a,b);
  }
  int main()
  {
      int x = 6, y = 7;
      myfunc(do_a(x),do_b(y));
  
      return 0;
  }
  </code></pre>
  
  <p>The problem is that function definition is expanded also like this</p>
  
  <pre><code>void myfunc(do_a(int a), do_b(int b))
  {
    do_blah(a,b);
  }
  </code></pre>
  
  <p>Is there any way to make macro expands only if we are expanding a function call?
  I tried many solutions, and it seems impossible but I hope that some one saw situation like this..</p>
  
  <p>NOTE: please don't tell me to rename the macro or function names :D</p>
  
  <p>Update1:
  Thanks for you help. But I can only change the definition of the macro, I can't change its position and I can't change function implementation.</p>