From Schmid.wiki
Jump to: navigation, search

Compiler Detection

Example code:

#if defined(_MSC_VER)
    // Visual Studio code
#elseif defined(__GNUC__)
    // gcc code
#else
#error "unknown compiler"
#endif

Compiler-specific defines:

__MINGW32__  - MinGW
_MSC_VER     - Visual Studio
__GNUC__     - Any gcc compiler