Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preprocessing in C++

Tags:

preprocessor

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
like image 384
Zygi Avatar asked Feb 18 '23 20:02

Zygi


1 Answers

#if defined( ENG ) && defined( POL )
#error You can't define both!
#endif
like image 168
Goz Avatar answered Apr 09 '23 01:04

Goz