Add #ifdefs needed to compile Gallium on Solaris with gcc or Sun cc
[mesa.git] / src / gallium / include / pipe / p_compiler.h
index bc2a0a7ef3ae278f0121c3859c43b8cda734c7a3..e6a67f8c2fd5ebacc446631d74ecaa3f6b69e539 100644 (file)
@@ -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.