title: Is there a way to 'escape' an ampersand in a C preprocessor macro?
body: <p>I have a library I am porting from Windows to Linux, and I am required to make the minimal number of changes necessary.
  There are some function calls in the library that I need to call variants of, with one less parameter and I am trying to use a macro to perform the substitutions. </p>
  
  <p>The issue is that these calls are passing the address of a structure and I'm getting the error <b>"error: "&amp;" may not appear in macro parameter list"</b></p>
  
  <p>For example, if the library has the following call:</p>
  
  <pre><code>foo(param1, &amp;param2); 
  </code></pre>
  
  <p>and I need to replace it with</p>
  
  <pre><code>foo_variant(&amp;param2);
  </code></pre>
  
  <p>I am adding a conditional compile at the top of the file as follows:</p>
  
  <pre><code>#if defined LINUX_VARIANT
      #define  foo(param1, &amp;param2)  foo_variant(&amp;param2)
  #endif
  </code></pre>
  
  <p>Is there any way to "escape" the ampersand to avoid this error?</p>
  
  <p>If not, I did see another post that mentioned that a pointer to the struct could be defined, and use the pointer instead of taking the structure's address, but I'd like to avoid that unless there is no other option. 
  Thanks ahead for any enlightenment! </p>