title: C Macro Token Concatenation involving a variable - is it possible?
body: <p>I'm trying to define a macro to generate a token name, containing a variable.</p>
  
  <p>Basically, what I'm trying is this:</p>
  
  <pre><code>#define GLUER(x,y,z) x##y##z
  #define PxDIR(x) GLUER(P,x,DIR)
  
  int main() {
    int port;
    port = 2;
    PxDIR(port) |= 0x01;
  }
  </code></pre>
  
  <p>I'm hoping to generate the token P2DIR in the above statement, but according to my compiler output, it's generating the token PportDIR, which is NOT what I wanted. Any help here? Or is what I'm attempting to do impossible?</p>