xf86-video-intel: src/common.h

Alan Coopersmith alanc at kemper.freedesktop.org
Fri Jun 23 01:07:23 EEST 2006


 src/common.h |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

New commits:
diff-tree dae9cb7712d5d8f88697ca83808c59af08364c0e (from 5a1b68993f3a3a2e8dcd428a7118e29c36703cd6)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Jun 22 15:07:16 2006 -0700

    Provide definitions of __FUNCTION__ for non-gcc compilers

diff --git a/src/common.h b/src/common.h
index a6e4ca3..31e67b9 100644
--- a/src/common.h
+++ b/src/common.h
@@ -39,13 +39,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #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", \



More information about the xorg-commit mailing list