summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h1
-rw-r--r--src/mesa/drivers/dri/common/xmlconfig.c6
-rw-r--r--src/mesa/main/glheader.h45
-rw-r--r--src/mesa/main/imports.h1
4 files changed, 48 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 203479e3267..f126d084064 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -53,6 +53,7 @@
#include <drm.h>
#include <drm_sarea.h>
#include <xf86drm.h>
+#include "glheader.h"
#include "GL/internal/glcore.h"
#include "GL/internal/dri_interface.h"
#include "GL/internal/dri_sarea.h"
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c
index 8602d47cf97..f6ae75520c5 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -63,6 +63,12 @@ extern char *program_invocation_name, *program_invocation_short_name;
#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
+#elif defined(__sun)
+/* Solaris has getexecname() which returns the full path - return just
+ the basename to match BSD getprogname() */
+# include <stdlib.h>
+# include <libgen.h>
+# define GET_PROGRAM_NAME() basename(getexecname())
#endif
#if !defined(GET_PROGRAM_NAME)
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
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 7ee26b423cc..00a18d3f15d 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -165,6 +165,7 @@ typedef union { GLfloat f; GLint i; } fi_type;
defined(__mips) || defined(_MIPS_ARCH) || \
defined(__arm__) || \
defined(__sh__) || defined(__m32r__) || \
+ (defined(__sun) && defined(_IEEE_754)) || \
(defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
#define USE_IEEE
#define IEEE_ONE 0x3f800000