c++c-preprocessordetectionconditional-compilationplatform-detection

Compiler version, name, and OS detection in C++


I need to detect the OS name, compiler name, and version of the compiler with C++, as I need to change the setup for each case.

How can I do that?


Solution

  • For most compilers you can find a list of predefined macros.