Add #ifdefs needed to compile Gallium on Solaris with gcc or Sun cc
[mesa.git] / src / gallium / include / pipe / p_compiler.h
index 7bcebd3d6b6c9c87c8b5ab95a87c83af02e1e74d..e6a67f8c2fd5ebacc446631d74ecaa3f6b69e539 100644 (file)
@@ -96,7 +96,6 @@ typedef int     _Bool;
 typedef unsigned int       uint;
 typedef unsigned char      ubyte;
 typedef unsigned short     ushort;
-typedef uint64_t           uint64;
 
 #if 0
 #define boolean bool
@@ -112,22 +111,43 @@ typedef unsigned char boolean;
 
 
 /* Function inlining */
-#ifdef __cplusplus
-#  define INLINE inline
-#elif defined(__GNUC__)
-#  define INLINE __inline__
-#elif defined(_MSC_VER)
-#  define INLINE __inline
-#elif defined(__ICL)
-#  define INLINE __inline
-#elif defined(__INTEL_COMPILER)
-#  define INLINE inline
-#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
-#  define INLINE __inline
-#else
-#  define INLINE
+#ifndef INLINE
+#  ifdef __cplusplus
+#    define INLINE inline
+#  elif defined(__GNUC__)
+#    define INLINE __inline__
+#  elif defined(_MSC_VER)
+#    define INLINE __inline
+#  elif defined(__ICL)
+#    define INLINE __inline
+#  elif defined(__INTEL_COMPILER)
+#    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.