This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to accumulate tokens in #define'd ident ?


Hi All,

I have a beginner question.
I have an ident that I #define this is a comma separated list of other
ident, and I'd like to augment this list, i.e basically something like

#define L a
#define T L
#undef L
#define L T,b

I have a growing list of ident (here a,b) I'd like to grow this as
include files to end up with a,b,c,d at some point this is given to a
va_args function like f(L)

Indeed I know that the above #define/#undef will not make it, yet I
tried a lot of combo with ## in macro like

#define A(l,x) l##,##x
#define l a
#define t A(l,b)
#undef l
#define l t

But nothing works.

Thanx for any helps
Cheers,
Phi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]