 <p>A macro definition cannot include preprocessor directives (anything beginning with a <code>#</code>).</p> <p>To conditionally expand to certain values requires rather involved macrology and might not always work out the way you want. The example above could be written something like this:</p> <pre><code>#define ONE_OR_TWO(...) ONE_OR_TWO_(__VA_ARGS__, 2, 1,) #define ONE_OR_TWO_(_1, _2, X, ...) X #define CAT(A, B) CAT_(A, B) #define CAT_(A, B) A ## B #define M(N) CAT(IF_, ONE_OR_TWO(CAT(IS_, N)))({\ code; \ code; \ }, N) #define IS_5 , #define IF_1(A, B) B #define IF_2(A, B) A M(5); //-&gt; { code; code; } M(8); //-&gt; 8 </code></pre> <p>This is incredibly fragile though. You can only use certain types of expression as the argument to <code>M</code>, for instance - they have to have a syntactic structure that allows for concatenation, and no unwrapped commas - and it only works for predetermined values (e.g. to compare against something more complicated than a simple number is not possible with this method, because you can't build a macro name out of a more complex expression).</p> <p>But in principle, it can be done. You just need thousands upon thousands of lines of macro definitions to cover a useful set of cases beyond the trivial ones like this. You can get those by using a metaprogramming library like <a href="https://github.com/VesaKarvonen/order-pp">Order-PP</a> or <a href="http://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/index.html">Boost.Preprocessor</a>, but be prepared for obscure error messages if you slip up in the syntax even slightly.</p>