summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glheader.h
diff options
context:
space:
mode:
authorAlan Coopersmith <[email protected]>2008-06-20 17:58:53 -0700
committerBrian Paul <[email protected]>2008-06-21 10:19:45 -0600
commite1f9adc27445ea3381af1f71cfec0317298be5b1 (patch)
tree6a150eaf2acbe07729d341c7ee8268ca7c4542fd /src/mesa/main/glheader.h
parentf30e4af73405aad3ec29b7337a3a0177e3fbe715 (diff)
Solaris port of Mesa 7.1 with autoconf support
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/glheader.h')
-rw-r--r--src/mesa/main/glheader.h45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index c6f81fdd7e6..533e4a2bd8d 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -76,6 +76,30 @@
# include <inttypes.h>
#endif
+/* For platforms that have the C99 standard uint*_t,
+ but not the commonly used u_int*_t */
+#if defined(__sun)
+# define u_int8_t uint8_t
+# define u_int16_t uint16_t
+# define u_int32_t uint32_t
+# define u_int64_t uint64_t
+# define u_intptr_t uintptr_t
+#endif
+
+/* Sun compilers define __i386 instead of the gcc-style __i386__ */
+#ifdef __SUNPRO_C
+# if !defined(__i386__) && defined(__i386)
+# define __i386__
+# elif !defined(__amd64__) && defined(__amd64)
+# define __amd64__
+# elif !defined(__sparc__) && defined(__sparc)
+# define __sparc__
+# endif
+# if !defined(__volatile)
+# define __volatile volatile
+# endif
+#endif
+
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
# define __WIN32__
# define finite _finite
@@ -195,6 +219,12 @@
# define INLINE inline
#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
# define INLINE __inline
+#elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
+# define INLINE inline
+# define __inline inline
+# define __inline__ inline
+#elif (__STDC_VERSION__ >= 199901L) /* C99 */
+# define INLINE inline
#else
# define INLINE
#endif
@@ -240,12 +270,17 @@
* If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
* Don't define it if using a newer Windows compiler.
*/
-#if defined(__VMS)
-# define __FUNCTION__ "VMS$NL:"
-#elif __STDC_VERSION__ < 199901L
-# if ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
+#ifndef __FUNCTION__
+# if defined(__VMS)
+# define __FUNCTION__ "VMS$NL:"
+# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
(!defined(_MSC_VER) || _MSC_VER < 1300)
-# define __FUNCTION__ "<unknown>"
+# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
+ (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+# define __FUNCTION__ __func__
+# else
+# define __FUNCTION__ "<unknown>"
+# endif
# endif
#endif