"Bob Paddock" <[EMAIL PROTECTED]> wrote:

> Is it valid to paste structure tokens with
> the preprocessor ## operator?

That's not the purpose of that operator.  It's rather intended to
allow forming completely new identifiers out of fragments, as in:

#define HD44780_PORT   A

#define GLUE(a, b)     a##b
#define PORT(x)        GLUE(PORT, x)
#define PIN(x)         GLUE(PIN, x)
#define DDR(x)         GLUE(DDR, x)

#define HD44780_PORTOUT    PORT(HD44780_PORT)
#define HD44780_PORTIN     PIN(HD44780_PORT)
#define HD44780_DDR        DDR(HD44780_PORT)

....
  HD44780_DDR = 0x0f;
  HD44780_PORTOUT = 42;
  x = HD44780_PORTIN;

For a structure, you've already got two separated identifiers anyway.

I've got the impression that everything's most likely much simpler
than you try to make it.  However, I've got a hard time following your
examples, which is partially caused by your mailer wrapping up long
lines so they become unreadable.

Can you write a complete example that is compilable (well, modulo the
error, of course)?  Either use a mailer that doesn't wrap lines, or
wrap them using \<newline> when inside a macro.  Alternatively, file
it as an attachment.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to