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]
Other format: [Raw text]

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


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