Conditional value for #define

I want to define the kDependentMacro macro as 38 if the kIndependentMacro macro is defined and 40 otherwise. What is the easiest way to do this?

0
source share
1 answer
#ifdef kIndependentMacro
#  define kDependentMacro 38
#else
#  define kDependentMacro 40
#endif
+6
source

Source: https://habr.com/ru/post/1789383/


All Articles