changeset 59:235fa90a2527

diagnostics
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Nov 2016 15:51:24 +0100
parents 67ed29980999
children 298b8b5e3dbc
files HelloWorld/main.cpp
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <stdio.h>
 
 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;
 }