This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
argument-count in variadic macros?
- To: gcc at gcc dot gnu dot org
- Subject: argument-count in variadic macros?
- From: Herbert Rosmanith <herp at wildsau dot idv-edu dot uni-linz dot ac dot at>
- Date: Wed, 29 Aug 2001 23:53:27 +0200 (MET DST)
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