summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-06-22 15:07:16 -0700
committerAlan Coopersmith <alanc@alf.(none)>2006-06-22 15:07:16 -0700
commitdae9cb7712d5d8f88697ca83808c59af08364c0e (patch)
treea8c1986ff1ad9f329516c31f5b228f10e07debf2 /src/common.h
parent5a1b68993f3a3a2e8dcd428a7118e29c36703cd6 (diff)
Provide definitions of __FUNCTION__ for non-gcc compilers
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common.h b/src/common.h
index a6e4ca3e..31e67b90 100644
--- a/src/common.h
+++ b/src/common.h
@@ -39,13 +39,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef _INTEL_COMMON_H_
#define _INTEL_COMMON_H_
-#ifdef __GNUC__
+/* Provide substitutes for gcc's __FUNCTION__ on other compilers */
+#ifndef __GNUC__
+# if defined(__STDC__) && (__STDC_VERSION__>=199901L) /* C99 */
+# define __FUNCTION__ __func__
+# else
+# define __FUNCTION__ ""
+# endif
+#endif
+
+
#define PFX __FILE__,__LINE__,__FUNCTION__
#define FUNCTION_NAME __FUNCTION__
-#else
-#define PFX __FILE__,__LINE__,""
-#define FUNCTION_NAME ""
-#endif
#ifdef I830DEBUG
#define MARKER() ErrorF("\n### %s:%d: >>> %s <<< ###\n\n", \