--- glib/configure.in-orig	2006-05-25 16:34:30.433228491 -0500
+++ glib/configure.in	2006-05-25 16:37:59.892740304 -0500
@@ -784,6 +784,15 @@ int main (int argc, char **argv)
 AC_MSG_RESULT($g_have_gnuc_visibility)
 AM_CONDITIONAL(HAVE_GNUC_VISIBILITY, [test x$g_have_gnuc_visibility = xyes])
 
+AC_MSG_CHECKING([whether using Sun Studio C compiler])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
+#else
+# include "error: this is not Sun Studio."
+#endif
+]], [[]])], [ g_have_sunstudio_visibility=yes ], [ g_have_sunstudio_visibility=no ])
+AC_MSG_RESULT($g_have_sunstudio_visibility)
+AM_CONDITIONAL(HAVE_SUNSTUDIO_VISIBILITY, [test x$g_have_sunstudio_visibility = xyes])
+
 # check for bytesex stuff
 AC_C_BIGENDIAN
 
@@ -2389,10 +2398,16 @@ _______EOF
 #define G_HAVE_GNUC_VISIBILITY 1
 #define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
 _______EOF
-	else
+        else
+          if test x$g_have_sunstudio_visibility = xyes ; then
+                cat >>$outfile <<_______EOF
+#define G_GNUC_INTERNAL __hidden
+_______EOF
+          else
 		cat >>$outfile <<_______EOF
 #define G_GNUC_INTERNAL
 _______EOF
+	  fi
 	fi
 
 
@@ -2718,6 +2733,7 @@ g_have_iso_cxx_varargs=$g_have_iso_cxx_v
 
 g_can_inline=$g_can_inline
 g_have_gnuc_visibility=$g_have_gnuc_visibility
+g_have_sunstudio_visibility=$g_have_sunstudio_visibility
 
 case xyes in
 x$ac_cv_c_bigendian)
--- glib-2.10.2/glib/gconvert.c-orig	2006-05-25 19:29:41.404268000 -0500
+++ glib-2.10.2/glib/gconvert.c	2006-05-25 19:29:56.031142000 -0500
@@ -92,7 +92,7 @@ try_to_aliases (const char **to_aliases,
   return FALSE;
 }
 
-extern const char **_g_charset_get_aliases (const char *canonical_name) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL extern const char **_g_charset_get_aliases (const char *canonical_name);
 
 /**
  * g_iconv_open:
--- glib-2.10.2/glib/gdebug.h-orig	2006-05-25 19:30:10.456129000 -0500
+++ glib-2.10.2/glib/gdebug.h	2006-05-25 19:30:19.934728000 -0500
@@ -52,7 +52,7 @@ typedef enum {
 GLIB_VAR gboolean _g_debug_initialized;
 GLIB_VAR guint _g_debug_flags;
 
-void _g_debug_init (void) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void _g_debug_init (void);
 
 G_END_DECLS
 
--- glib-2.10.2/glib/gmessages.h-orig	2006-05-25 19:30:27.199538000 -0500
+++ glib-2.10.2/glib/gmessages.h	2006-05-25 19:33:45.643227000 -0500
@@ -103,10 +103,10 @@ GLogLevelFlags  g_log_set_fatal_mask    
 GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 
 /* internal */
-void	_g_log_fallback_handler	(const gchar   *log_domain,
-				 GLogLevelFlags log_level,
-				 const gchar   *message,
-				 gpointer       unused_data) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void	_g_log_fallback_handler	(const gchar   *log_domain,
+						 GLogLevelFlags log_level,
+						 const gchar   *message,
+						 gpointer       unused_data);
 
 /* Internal functions, used to implement the following macros */
 void g_return_if_fail_warning (const char *log_domain,
--- glib-2.10.2/glib/gthreadinit.h-orig	2006-05-25 19:31:04.094762000 -0500
+++ glib-2.10.2/glib/gthreadinit.h	2006-05-25 19:31:43.624356000 -0500
@@ -27,19 +27,19 @@ G_BEGIN_DECLS
 void g_thread_init_glib (void);
 
 /* base initializers, may only use g_mutex_new(), g_cond_new() */
-void _g_mem_thread_init_noprivate_nomessage (void) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void _g_mem_thread_init_noprivate_nomessage (void);
 /* initializers that may also use g_private_new() */
-void _g_slice_thread_init_nomessage	    (void) G_GNUC_INTERNAL;
-void _g_messages_thread_init_nomessage      (void) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void _g_slice_thread_init_nomessage	    (void);
+G_GNUC_INTERNAL void _g_messages_thread_init_nomessage      (void);
 
 /* full fledged initializersa */
-void _g_convert_thread_init (void) G_GNUC_INTERNAL;
-void _g_rand_thread_init (void) G_GNUC_INTERNAL;
-void _g_main_thread_init (void) G_GNUC_INTERNAL;
-void _g_atomic_thread_init (void) G_GNUC_INTERNAL;
-void _g_utils_thread_init (void) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void _g_convert_thread_init (void);
+G_GNUC_INTERNAL void _g_rand_thread_init (void);
+G_GNUC_INTERNAL void _g_main_thread_init (void);
+G_GNUC_INTERNAL void _g_atomic_thread_init (void);
+G_GNUC_INTERNAL void _g_utils_thread_init (void);
 #ifdef G_OS_WIN32
-void _g_win32_thread_init (void) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL void _g_win32_thread_init (void);
 #endif
 
 G_END_DECLS
--- glib-2.10.2/glib/gunicodeprivate.h-orig	2006-05-25 19:31:52.624739000 -0500
+++ glib-2.10.2/glib/gunicodeprivate.h	2006-05-25 19:32:49.557330000 -0500
@@ -25,10 +25,11 @@
 
 G_BEGIN_DECLS
 
-gunichar *_g_utf8_normalize_wc       (const gchar    *str,
-                                      gssize          max_len,
-                                      GNormalizeMode  mode) G_GNUC_INTERNAL;
-gint      _g_unichar_combining_class (gunichar uc) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL gunichar *_g_utf8_normalize_wc
+				(const gchar    *str,
+				gssize          max_len,
+				GNormalizeMode  mode);
+G_GNUC_INTERNAL gint      _g_unichar_combining_class (gunichar uc);
 
 G_END_DECLS
 
--- glib-2.10.2/glib/gutf8.c-orig	2006-05-25 19:33:06.432464000 -0500
+++ glib-2.10.2/glib/gutf8.c	2006-05-25 19:33:16.260823000 -0500
@@ -435,7 +435,7 @@ get_alias_hash (void)
 /* As an abuse of the alias table, the following routines gets
  * the charsets that are aliases for the canonical name.
  */
-const char ** G_GNUC_INTERNAL
+G_GNUC_INTERNAL const char ** 
 _g_charset_get_aliases (const char *canonical_name)
 {
   GHashTable *alias_hash = get_alias_hash ();
--- glib-2.10.2/gobject/gtype.h-orig	2006-05-25 19:42:17.248677000 -0500
+++ glib-2.10.2/gobject/gtype.h	2006-05-25 19:42:46.271585000 -0500
@@ -428,15 +428,15 @@ G_CONST_RETURN gchar* g_type_name_from_c
 
 
 /* --- internal functions --- */
-void    g_value_c_init          (void) G_GNUC_INTERNAL; /* sync with gvalue.c */
-void    g_value_types_init      (void) G_GNUC_INTERNAL; /* sync with gvaluetypes.c */
-void    g_enum_types_init       (void) G_GNUC_INTERNAL; /* sync with genums.c */
-void    g_param_type_init       (void) G_GNUC_INTERNAL; /* sync with gparam.c */
-void    g_boxed_type_init       (void) G_GNUC_INTERNAL; /* sync with gboxed.c */
-void    g_object_type_init      (void) G_GNUC_INTERNAL; /* sync with gobject.c */
-void    g_param_spec_types_init (void) G_GNUC_INTERNAL; /* sync with gparamspecs.c */
-void    g_value_transforms_init (void) G_GNUC_INTERNAL; /* sync with gvaluetransform.c */
-void    g_signal_init           (void) G_GNUC_INTERNAL; /* sync with gsignal.c */
+G_GNUC_INTERNAL void    g_value_c_init          (void); /* sync with gvalue.c */
+G_GNUC_INTERNAL void    g_value_types_init      (void); /* sync with gvaluetypes.c */
+G_GNUC_INTERNAL void    g_enum_types_init       (void); /* sync with genums.c */
+G_GNUC_INTERNAL void    g_param_type_init       (void); /* sync with gparam.c */
+G_GNUC_INTERNAL void    g_boxed_type_init       (void); /* sync with gboxed.c */
+G_GNUC_INTERNAL void    g_object_type_init      (void); /* sync with gobject.c */
+G_GNUC_INTERNAL void    g_param_spec_types_init (void); /* sync with gparamspecs.c */
+G_GNUC_INTERNAL void    g_value_transforms_init (void); /* sync with gvaluetransform.c */
+G_GNUC_INTERNAL void    g_signal_init           (void); /* sync with gsignal.c */
 
 
 /* --- implementation bits --- */
