[gnu.gcc.bug] Preprocessor help!

paul@UUNET.UU.NET (Paul Hudson) (01/20/89)

There's almost certainly a better place for this, but I don't have access
to news, so I thought I'd try here.

I would like to declare one of a number of types, for example

typedef int  Type1;
typedef int Type2;

If the trailing number is fixed -
#define CAT(a, b)
typedef int CAT(Type, 1);

will do it. However, I'd like to make the number another macro definition.
Ie.
#define N 6
#define CAT(a, b)
typedef int CAT(Type, N);

This gives
typedef TypeN;

because ##-processing happens before macro-rescanning. Is there any way
I can do what I require?


Paul Hudson 

Snail mail: Monotype ADG	Email:	...!ukc!acorn!moncam!paul
	    Science Park,		paul@moncam.co.uk
	    Milton Road,	"Sun Microsysytems:
	    Cambridge,		 The Company is Arrogant (TM)"
	    CB4 4FQ