This is the mail archive of the gcc@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]

argument-count in variadic macros?



hello,

consider the following macro:

#define macro(a,b,....) mac##__VA_COUNT__(a,b,##__VA_ARGS__)
void mac0(a,b)
[...]
void mac1(a,b,c)
[...]
void mac1(a,b,c)

and so on.

you get the idea: the argument count of varargs is part of the function
body. of course, there is no such thing as a "__VA_COUNT__". (I've even
looked in the CPP sources).

my question: how, if at all, can I get the argument count of VA_ARGS?



-- 
mfg,
Dipl.-Ing. H.Rosmanith                    Karrer & Partner Gesellschaft mbH
Freistaedter Str. 236, A-4040 Linz,                   Tel. +43/732/75 71 30
                                                      Fax. +43/732/75 71 44


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