Zygi
Zygi

Reputation: 794

Preprocessing in C++

How to make that when I define both instructions at the same time I will get the compilation error? Here I want error

#define ENG
#define POL
#if defined POL
#if defined ENG

Here not

#define ENG
//#define POL
#if defined POL
#if defined ENG

Upvotes: 4

Views: 185

Answers (1)

Goz
Goz

Reputation: 62323

#if defined( ENG ) && defined( POL )
#error You can't define both!
#endif

Upvotes: 8

Related Questions