title: How can I detect g++ and MinGW in C++ preprocessor?
body: <p>I want to do something like:</p>
  
  <pre><code>#ifdef GCC
  #define GetFunctionName() string("My function name is ") + __PRETTY_FUNCTION__;
  #endif
  </code></pre>
  
  <p>Since I want to use pretty <strong>PRETTY_FUNCTION</strong> this is only supported by gnu as far as I know so I need to detect if I am compiling for g++ and MinGW, how can I do that?  I'm guessing all I need to know are the compiler's preprocessor definitions, like I did for Microsoft below.</p>
  
  <pre><code>#ifdef WIN32
  #define LogFuncBegin() gLogger.FuncBegin( __FUNCTION__ );
  #define LogFuncEndSuccess() gLogger.FuncEndSuccess( __FUNCTION__ );
  #endif
  </code></pre>
  
  <p>How can I detect g++ and MinGW in C++ preprocessor?</p>