summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe/p_compiler.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-03-23 20:17:57 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-03-25 11:07:31 -0700
commitad11107206ff4954366d77f334431b637ee256fa (patch)
tree2ee36a6ba1e6c3dc580d8806845cb1cddb90bedd /src/gallium/include/pipe/p_compiler.h
parent6dd9c221012d5e091b2ede90d9b2a6f0383abd58 (diff)
Add #ifdefs needed to compile Gallium on Solaris with gcc or Sun cc
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'src/gallium/include/pipe/p_compiler.h')
-rw-r--r--src/gallium/include/pipe/p_compiler.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index bc2a0a7ef3..e6a67f8c2f 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -124,11 +124,30 @@ typedef unsigned char boolean;
# define INLINE inline
# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
# define INLINE __inline
+# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
+# define INLINE inline
+# elif (__STDC_VERSION__ >= 199901L) /* C99 */
+# define INLINE inline
# else
# define INLINE
# endif
#endif
+/* The __FUNCTION__ gcc variable is generally only used for debugging.
+ * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
+ */
+#ifndef __FUNCTION__
+# if (!defined(__GNUC__) || (__GNUC__ < 2))
+# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
+ (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+# define __FUNCTION__ __func__
+# else
+# define __FUNCTION__ "<unknown>"
+# endif
+# endif
+#endif
+
+
/* This should match linux gcc cdecl semantics everywhere, so that we
* just codegen one calling convention on all platforms.