title: How to find out if this preprocessor macro exists?
body: <p>I want to know how to find out if the preprocessor macro <code>__PRETTY_FUNCTION__</code> can be used with a given compiler (As it is supposed to be non-standard). How do I check this in a header file? What I want to do is something like:</p>
  
  <pre><code>#ifndef __PRETTY_FUNCTION__
     #define __PRETTY_FUNCTION__ __func__
  #endif
  </code></pre>
  
  <p>But, I'm guessing what happens is the preprocessor defines the macro in place for each function so I wonder whether there's any meaning to <code>__PRETTY_FUNCTION__</code> (Unlike <code>__FILE__</code> or <code>__LINE__</code>) outside a function. Is this true or can I just use the code above? If not, how do I check for it?</p>
  
  <p>EDIT: I tried it. <code>__PRETTY_FUNCTION__</code> is undefined outside a function (I didn't check inside a class). So there has to be another way.</p>
  
  <p>EDIT2: Actually a simple hack would be to do this :):</p>
  
  <pre><code>void Dummy()
  {
      #ifndef __PRETTY_FUNCTION__
         #define __PRETTY_FUNCTION__ __func__
      #endif
  }
  </code></pre>
  
  <p>The other method is to check for compiler as was suggested by others.</p>