PP: is macro expansion cached?
12 Feb
2010
12 Feb
'10
10:10 p.m.
Hello, Say I define a macro #define MYMACRO(x,y) .. MYMACRO because of various reasons takes very long to expand (1mn) (uses PP_FOR, PP_WHILE, PP_SEQ_FOR_EACH .). If later in the translation unit, I have a "call" to MYMACRO MYMACRO(a,b) and then a couple of lines later MYMACRO(a,b) Will it be faster to define line 15: #define MYMACRO_ab MYMACRO(a,b) and then use line 25: MYMACRO_ab . line 35: MYMACRO_ab When does MYMACRO expansion happen? Is it at line 15 once, or at lines 25 and 35? Is the answer compiler-dependent? Regards,
5389
Age (days ago)
5389
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hicham Mouline