<div dir="ltr">I'd really rather not muck around in the implementors namespace like this.  If the compiler is actually clang-cl (which claims to be MSVC) or MSVC 2013 CTP, then __func__ will be available, and who knows what will happen.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 12:31 PM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@bec.de" target="_blank">joerg@bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: joerg<br>
Date: Wed Feb 26 14:31:17 2014<br>
New Revision: 202296<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=202296&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=202296&view=rev</a><br>
Log:<br>
Emulate C99/C++11 __func__ for Visual C++.<br>
<br>
Modified:<br>
    compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
<br>
Modified: compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=202296&r1=202295&r2=202296&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=202296&r1=202295&r2=202296&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake (original)<br>
+++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake Wed Feb 26 14:31:17 2014<br>
@@ -11,6 +11,9 @@ macro(clang_compile object_file source)<br>
   if(NOT COMPILER_RT_STANDALONE_BUILD)<br>
     list(APPEND SOURCE_DEPS clang)<br>
   endif()<br>
+  if (MSVC)<br>
+    list(APPEND SOURCE_CFLAGS -D__func__=__FUNCTION__)<br>
+  endif()<br>
   add_custom_command(<br>
     OUTPUT ${object_file}<br>
     COMMAND ${COMPILER_RT_TEST_COMPILER} ${SOURCE_CFLAGS} -c -o "${object_file}"<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>