summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKarl Schultz <[email protected]>2002-04-19 15:49:40 +0000
committerKarl Schultz <[email protected]>2002-04-19 15:49:40 +0000
commit4fa66fa85ccc1b35411c1deb65119cde6c9d44a4 (patch)
treece0bc7895f9697e1c6b7b5485bc78603e3ceb80b /src/mesa
parentbf80e1ed620836e2ca0dd3f7d2d4cb187d17563d (diff)
Provide a reasonable replacement for __FUNCTION__ when using non GNU C
compilers. This allows Mesa to compile with non GNU C compilers again.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4eec17874e2..6dde32b52c1 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.70 2002/04/09 16:56:50 keithw Exp $ */
+/* $Id: mtypes.h,v 1.71 2002/04/19 15:49:40 kschultz Exp $ */
/*
* Mesa 3-D graphics library
@@ -1849,7 +1849,15 @@ enum _debug {
#define Elements(x) sizeof(x)/sizeof(*(x))
-
+/*
+ * Provide a reasonable replacement for __FUNCTION__ when using
+ * non-GNU C compilers.
+ */
+#if !defined(__GNUC__)
+#define STRINGIZE(x) #x
+#define STRINGIZE_EVAL(x) STRINGIZE(x)
+#define __FUNCTION__ STRINGIZE_EVAL(__FILE__) ", line " STRINGIZE_EVAL(__LINE__)
+#endif
/* Eventually let the driver specify what statechanges require a flush:
*/