[aspectc-user] using #define whith __VA_ARGS__

Leandro Costa leandro.costa at gmail.com
Thu Nov 27 01:53:57 CET 2008


I have the following macro:

#define LOGMSG(level, buffer, ...) Logger::lprintf (level, buffer,
##_VA_ARGS__)

And in a certain C.cc file, I do the following:

LOGMSG (SILENT, "C::%s () - debugging...\n", __FUNCTION__,);

When a run ac++, I get the following:

* Running ac++ 1.0pre3
* Handling Translation Unit `C.cc'.
C.cc:30: error: pasting "," and "__FUNCTION__" does not give a valid
preprocessing token

If I remove the ##, it works, but this way I can't execute LOGMSG with a
empty list of __VA_ARGS__

Does anybody know why?

Thanks in advance!!!

-- 
_____________________________________________

                      Leandro Souza Costa

"A vitória se encastela em jardins encantadores,
 mas para se chegar a ela não há caminho de flores"
_____________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20081126/d6eb5be3/attachment.html>


More information about the aspectc-user mailing list