# HG changeset patch # User Sebastien Jodogne # Date 1479307884 -3600 # Node ID 235fa90a2527b934369ded7267e196658282a547 # Parent 67ed29980999c2591d746ed71f3e4723b3a071dd diagnostics diff -r 67ed29980999 -r 235fa90a2527 HelloWorld/main.cpp --- a/HelloWorld/main.cpp Wed Nov 16 15:30:51 2016 +0100 +++ b/HelloWorld/main.cpp Wed Nov 16 15:51:24 2016 +0100 @@ -1,7 +1,33 @@ +// https://sourceforge.net/p/predef/wiki/Compilers/ + #include int main() { printf("Hello world!\n"); + + +#ifdef NDEBUG + printf("This is a release build.\n"); +#else + printf("This is a debug build.\n"); +#endif + + +#if defined(__MINW64__) + printf("This build was compiled using MinGW64.\n"); +#elif defined(__MINW32__) + printf("This build was compiled using MinGW32.\n"); +#elif defined(__GNUC__) + printf("This build was compiled using gcc.\n"); +#elif defined(__clang__) + printf("This build was compiled using clang.\n"); +#elif defined(_MSC_VER) + printf("This build was compiled using Microsoft Visual Studio version %04d.\n", _MSC_VER); +#else + printf("WARNING: Unknown compiler.\n"); +#endif + + return 0; }