jeudi 1 août 2019

"unix" C++ preprocessor macro is undefined for Intel compiler with -std=c++11

unixpreproc.cpp

#ifdef unix
#warning "unix is defined"
#endif

#ifdef __unix__
#warning "__unix__ is defined"
#endif

void main() {}

Using Intel C++ compiler 19.0.3:

icpc -o unixpreproc unixpreproc.cpp shows that both unix and __unix__ macros are defined

but

icpc -std=c++11 -o unixpreproc unixpreproc.cpp shows that only __unix__ is defined. Is this deliberate? Is it documented somewhere?

Aucun commentaire:

Enregistrer un commentaire