gallium: Define __func__ on MSVC.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 4 Mar 2011 11:46:13 +0000 (11:46 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 4 Mar 2011 11:55:36 +0000 (11:55 +0000)
src/gallium/include/pipe/p_compiler.h

index 3d6b5b5c81d4fcf0babf750caf8ab6aea33426f1..3441db685ce44c3f5fbb9957db40c5b571d25d1b 100644 (file)
@@ -171,6 +171,18 @@ typedef unsigned char boolean;
 #  define __FUNCTION__ "<unknown>"
 # endif
 #endif
+#ifndef __func__
+#  if (__STDC_VERSION__ >= 199901L) || \
+      (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+       /* __func__ is part of C99 */
+#  elif defined(_MSC_VER)
+#    if _MSC_VER >= 1300
+#      define __func__ __FUNCTION__
+#    else
+#      define __func__ "<unknown>"
+#    endif
+#  endif
+#endif