This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Parametrized macro names
- From: Fabio Alemagna <falemagn at studenti dot unina dot it>
- To: Tom Lord <lord at emf dot net>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Wed, 5 Mar 2003 05:22:09 +0100 (CET)
- Subject: Re: [RFC] Parametrized macro names
On Wed, 5 Mar 2003, Fabio Alemagna wrote:
> But then, given the fact that it would break compatibility with existing
> code, let's forget about it.
Hum, actually I'm wrong there, I don't need the 2nd thing I asked for.
Let's look at a real case, the one that made me think about this RFC.
I have the need to write macros which look like this one:
#define SuperMIArgs_MyClass(obj, args...) \
SuperMIArgs(MyClass, obj, args)
They all look alike, except for the "MyClass" part, which gets replaced by
the name of the class I need to write that macro for.
Given that the name of the class has to be put in a macro already, the
above definition could look like this:
#define SuperMIArgs_ ## ClassName(obj, args...) \
SuperMIArgs(ClassName, obj, args)
And I could put it in the global include file which I already use, and be
sure that it will work for all cases.
Regards,
Fabio Alemagna