Can you convert __func__ to a wchar_t[] at compile time?
<p>So I have this snippet of  code</p>

<pre><code>wchar_t funcName[] = __FUNCTIONW__;
</code></pre>

<p>but the problem with <code>__FUNCTIONW__</code> is it has class info in the name when all I want is the function name. Now<code>__FUNCTIONW__</code> just calls <code>_CRT_WIDE(__FUNCTION__)</code> which made me think I could call <code>_CRT_WIDE(__func__)</code> but that gives an error "identifier L__func__ is undefined"</p>

<p><code>__func__</code> is an implicitly declared identifier that expands to a character array variable containing the function name when it is used inside of a function.  It was added to C in C99.  From <a href="http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf">C99</a> §6.4.2.2/1:</p>

<blockquote>
  <p>The identifier <code>__func__</code> is implicitly declared by the translator as if, immediately following the opening brace of each function definition, the declaration</p>

<pre><code>static const char __func__[] = "function-name";
</code></pre>
  
  <p>appeared, where function-name is the name of the lexically-enclosing function.  This name is the unadorned name of the function.</p>
</blockquote>

<p>I take this to mean __func_ is  not a macro and it has nothing to do with preprocessing?</p>

<p>Is there another way I can get a wchar_t array at compile time?</p>