I want to define a macro kDependentMacro to be 38 if the macro kIndependentMacro is defined and 40 otherwise. What is the simplest way to do that?
+5
A:
#ifdef kIndependentMacro
# define kDependentMacro 38
#else
# define kDependentMacro 40
#endif
seren23
2010-06-14 22:11:51
ugh. I was hoping there was something prettier. Judging by the fact that this already has 4 upvotes, apparently not :(
William Jockusch
2010-06-14 22:39:36