title: Aliasing functions and definitions in C
body: <p>I have a set of <strong>C</strong> API functions/definitions prefixed: Abc_* and ABC_*</p>
  
  <pre><code>Abc_Function1(int a);
  #define ABC_TEST 1
  </code></pre>
  
  <p>In the next version of the API, I need to rename all of these to: <code>Xyz_*</code> and <code>XYZ_*</code></p>
  
  <p>To avoid breaking the flow for people using the previous version of the API, I want to making some compatibility definitions such that the user may invoke the same function using <code>Abc_Function1()</code> or <code>Xyz_Function1()</code>.</p>
  
  <p>I've tried the following:</p>
  
  <pre><code>Xyz_Function1(int a);
  #define XYZ_TEST 1
  
  #define Abc_ Xyz_
  #define ABC_ XYZ_
  ...
  Xyz_Function1(ABC_TEST); // Returns an error (ABC_TEST not defined)
  Abc_Function1(XYZ_TEST); // Returns an error (implicit Abc_Function1)
  </code></pre>
  
  <p>When I try to use <code>XYZ_TEST</code> or <code>Xyz_Function1()</code> by using the, I would have expected that the preprocessor renames the user's usage of <code>Abc_*</code> and <code>ABC_*</code> to <code>Xyz_*</code> and<code>XYZ_*</code> but it doesn't work.</p>
  
  <p>Is there anything I'm missing or is there another way to do this?</p>