title: Macro concatenation inside other macro concatenation in c
body: <p>I have the following macros:</p>
  
  <pre><code>#define    __IR( x )        ICU.IR[ IR ## x ].BIT.IR
  #define     _IR( x )        __IR( x )
  #define      IR( x , y )    _IR( _ ## x ## _ ## y )
  </code></pre>
  
  <p>I use it in this way: </p>
  
  <pre><code>IR(SCI7, RXI7) = 0;
  </code></pre>
  
  <p>That expands to:</p>
  
  <pre><code>ICU.IR[ IR_SCI7_RXI7 ].BIT.IR = 0
  </code></pre>
  
  <p>Instead of use <code>SCI7</code> and <code>RXI7</code> I'd like to use <code>sci(channel)</code> and <code>rxi(channel)</code>. So I've tried to create the following macros:</p>
  
  <pre><code>#define _sci(x)  SCI ## x
  #define  sci(x)  _sci(x)
  #define _rxi(x)  RXI ## x
  #define  rxi(x)  _rxi(x)
  
  #define channel 7
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>IR(sci(channel), rxi(channel)) = 0;
  </code></pre>
  
  <p>But it didn't work. The compiler returns me: </p>
  
  <blockquote>
    <p>Error[Pe017]: expected a "]" </p>
  </blockquote>
  
  <p>I've been trying to with other manners also but without success. </p>
  
  <p>What I'm doing wrong?</p>