Define G_GNUC_INTERNAL for Sun Studio as __hidden. (#342981, Brian

2007-01-26  Matthias Clasen <mclasen@redhat.com>

        * configure.in: Define G_GNUC_INTERNAL for Sun Studio
        as __hidden.  (#342981, Brian Cameron)

        * glib/gconvert.c:
        * glib/gutf8.c: Move G_GNUC_INTERNAL uses to the right
        spot.

2

svn path=/trunk/; revision=5317
This commit is contained in:
Matthias Clasen
2007-01-27 03:34:48 +00:00
committed by Matthias Clasen
parent f90d6d821d
commit df3dd538e5
6 changed files with 56 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
2007-01-26 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/macros_misc.sgml: Document G_GNUC_INTERNAL
support for Sun Studio.
2007-01-23 Matthias Clasen <mclasen@redhat.com>
* gobject/tmpl/objects.sgml: Document

View File

@@ -309,12 +309,29 @@ Since: 2.6
<!-- ##### MACRO G_GNUC_INTERNAL ##### -->
<para>
Expands to the GNU C <literal>visibility(hidden)</literal> attribute if the
compiler supports it (currently only <command>gcc</command>). This attribute
can be used for marking library functions as being used internally to the lib
only, to not create inefficient PLT entries. Note that static functions do not
need to be marked as internal in this way. See the GNU C documentation for details.
This attribute can be used for marking library functions as being used
internally to the library only, which may allow the compiler to handle
function calls more efficiently.
Note that static functions do not need to be marked as internal in this way.
See the GNU C documentation for details.
</para>
<para>
When using a compiler that supports the GNU C hidden visibility attribute,
this macro expands to <literal>__attribute__((visibility("hidden")))</literal>.
When using the Sun Studio compiler, it expands to <literal>__hidden</literal>.
</para>
<para>
Note that for portability, the attribute should be placed before the
function declaration. While GCC allows the macro after the declaration,
Sun Studio does not.
</para>
<informalexample><programlisting>
G_GNUC_INTERNAL
void _g_log_fallback_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data);
</programlisting></informalexample>
Since: 2.6