Problem with macro params containing commas
Nathan Sidwell
nathan@codesourcery.com
Thu Aug 14 20:22:00 GMT 2003
Jean-Eric Cuendet wrote:
> Hi,
> I'd like to pass params that contains commas to a macro.
> But the macro processor think that the passed param is 2 parts (separated by the
> inner macro). It's normal, but not what I want...
> Is there a way to do it differently?
> Thanks
> -jec
>
> #define MACRO_PARAM_1 <class First,class Second>
> #define MACRO_PARAM_2 Fn_Pair<First,Second>
>
> FN_DEFINE_TEMPLATE_CLASS_METHODS( MACRO_PARAM_1, MACRO_PARAM_2, Fn_Kind,
> Fn_Pair_CLASS_ID );
>
several ways to do this
* varadic macros supported in C99, and gnu C (in slightly different ways)
* a parenthesized list of additional parms - depends on what you want to do with them
*
#define _ ,
#define macro(parm) whatever
macro (arg1 _ arg2 _ arg3)
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
More information about the Gcc
mailing list