c preprocessor - How to define a define in C? -


is possible write #define defines #define?

for example:

#define fid_strs(x) #x #define fid_stre(x) fid_strs(x) #define fid_decl(n, v) static int fidn_##n = v;static const char *fids_##n = fid_stre(v) 

but instead:

#define fid_decl2(n, v) #define fidn_##n v \                                fids_##n fid_stre(v) 

fid_decl works fine creates 2 static variables. possible make fid_decl2 work , having define 2 defines?

no; preprocessing performed in single pass. if want or need more advanced behavior, consider using tool preprocess source, m4.

further, # in replacement list (at beginning of #define fidn... parsed # (stringize) operator: operand of operator must named macro parameter, define not.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -