[desktop-discuss] Re: Xfce

Brian Cameron Brian.Cameron at Sun.COM
Sun Feb 4 21:35:06 PST 2007


Doug/Damien:

Yes, sorry, it is my fault that the macro is causing you troubles.
Making this macro work with Sun Studio was an ARC requirement since
they want to ensure that we never expose interfaces that are not
intended to be exposed.  It is unfortunate that the Sun Studio
__hidden macro is not as flexible as the GCC "hidden" attribute.
The GCC "hidden" attribute can be defined before or after the
function declaration, but the Sun Studio __hidden macro must be
defined at the beginning.

We have worked with the GNOME maintainers and now our patches
to support the Sun Studio __hidden syntax is supported upstream
by glib and most (if not all) GNOME modules now define it at the
beginning.

Refer to glib bug: 342981

   http://bugzilla.gnome.org/show_bug.cgi?id=342981

I'd recommend that you provide the Xfce maintainers a patch to
move the macro to the beginning since, as the above bug report
says, the glib module now recommends that the macro be used
at the beginning for Sun Studio support.  I'd reference the above
bug report as an argument that they should accept such a patch.

Or, perhaps better, the module should be using the X macros
(I'm assuming with a name like Xfce it is more closely related
to X)?

if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
# define _X_HIDDEN      __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define _X_HIDDEN      __hidden
#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
# define _X_HIDDEN
#endif

This also needs to be at the beginning, but _X_HIDDEN might
be better than using the G_GNUC_HIDDEN macro.  It has a better
name, anyway (the fact that the glib macro has GNUC in its
name is a bit confusing).

Brian


>> Yeah, there is a lot of gcc funk in the header files.
>> The G_BEGIN_DECLS ended with semi-colons are the
>> easiest to fix (using 'find' and a 'ex' script). It
>> is the G_GNUC_HIDDEN etc put at the end of a function
>> definition which take a lot of editing to fix. I have
>> been considering writing a small C program to move
>> the annotations to the front of the function so Sun
>> Pro C doesn't barth. Of course getting Sun Pro to
>> accept either is the best solution, but out of my
>> control.... 
> 
> This sounds like the G_GNUC_INTERNAL changes that had to be made throughout the JDS source.
> e.g. in glib:
> -void _g_debug_init (void) G_GNUC_INTERNAL;
> +G_GNUC_INTERNAL void _g_debug_init (void);
> 
> Brian Cameron enhanced glib's definition of G_GNUC_INTERNAL to make it non-blank and useful on the forte compiler.
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> desktop-discuss mailing list
> desktop-discuss at opensolaris.org




More information about the desktop-discuss mailing list