title: __func__ and __PRETTY_FUNCTION__ not always expanded
body: <p>I have a log library that uses a macro to trace a message. This macro makes use of predefined macros like <code>__func__</code> and <code>__PRETTY_FUNCTION__</code> to indicate in which function/method the message was logged.</p>
  
  <p>The macro of my log library is defined in the main header of my log library, outside any function.</p>
  
  <p>For some reason, the preprocessed code contains <code>__func__</code> (or <code>__PRETTY_FUNCTION__</code> if i'm using this one) litterally, just like if these predefined macros didn't exist. But i know they DO exist because if i'm using them without using my lib's trace macro, they work !</p>
  
  <p>Here is my libs macro :</p>
  
  <pre><code>#if _MSC_VER &gt;= 1400 // If &gt;= VS2005
  
      #define _TRACE_FUNC_SIGNATURE __FUNCSIG__
  
  #elif defined(__ANDROID__) || defined( __GNUC__ ) &amp;&amp; defined( __cplusplus ) // If G++ and/or Android NDK
  
      #define _TRACE_FUNC_SIGNATURE __func__
  
  #else
      #error // Unsupported compiler
  #endif
  
  // Forces the reprocessing of x to properly expand __VA_ARGS__ when using MSVC compiler
  #define _TRACE_REPROCESS( x ) x
  
  
  #define _TRACE_X( _methodName_, _logCatPtr_, ... ) \
      do { \
          ::dbg::LogCategory * const _catPtrVal_ = (::dbg::LogCategory *)(_logCatPtr_); \
          if( NULL != _catPtrVal_ &amp;&amp; _catPtrVal_-&gt;IsEnabled() ) \
          { \
              _TRACE_REPROCESS( _catPtrVal_-&gt;_methodName_( _TRACE_FUNC_SIGNATURE " - " __VA_ARGS__ ); ) \
          } \
      } while( false )
  
  
  #define TRACE_E( _logCatPtr_, ... ) _TRACE_X( Error, _logCatPtr_, __VA_ARGS__ )
  #define TRACE_W( _logCatPtr_, ... ) _TRACE_X( Warning, _logCatPtr_, __VA_ARGS__ )
  #define TRACE_I( _logCatPtr_, ... ) _TRACE_X( Info, _logCatPtr_, __VA_ARGS__ )
  </code></pre>
  
  <p>I know that these macros have no reason to be defined outside a function, but since i'm only using my trace macro inside functions/methods, then it should be defined there !</p>
  
  <p>I'm using the default Android NDK compiler provided with eclipse, which as I read is some kind of extended G++.</p>
  
  <p><strong>EDIT</strong> : If I replace <code>__func__</code> by an actual string litteral, it works, no syntax error. This lets me think that <code>__func__</code> is definately not defined when used in my macro.</p>