title: Wrap function call with macro
body: <p>Is it possible to wrap only function call with macro?</p>
  
  <p>When I'm trying </p>
  
  <pre><code>#define foo(x) bar(x)
  </code></pre>
  
  <p>it wraps both function call and definition. </p>
  
  <p>I know about wrapping function with linker, but in this case I can't use this solution.</p>
  
  <p>Lets assume some code</p>
  
  <pre><code>#define foo(x) bar(z)
  
  int foo(int z){
  //some code
  }
  
  int bar(int x){
  //some code
  }
  
  int function(){
  int a = foo(2);
  }
  </code></pre>
  
  <p>I want to int a = foo(2); after preprocessing become int a = bar(2).
  Currently I only receive "redefinition" error.  </p>
  
  <p>Edit: my example shows, what I want to achieve, but I in real code I have to put this macro to project via cmake file and I also can't modify source code in destination file. Sorry for not mention about it earlier.</p>