Add a G_GNUC_INTERNAL macro to mark function declarations as internal and

2004-08-02  Matthias Clasen  <mclasen@redhat.com>

	* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
	declarations as internal and avoid PLT indirections for
	them.  (#145465, Arjan van de Ven)

	* glib/gunicodeprivate.h:
	* glib/gthreadinit.h:
	* glib/gmessages.h:
	* glib/gdebug.h:
	* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
	_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
	_g_messages_thread_init(), _g_convert_thread_init(),
	_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
	_g_mem_thread_private_init(), _g_messages_thread_private_init(),
	_g_utf8_normalize_wc() and _g_unichar_combining_class().

	* glib/gatomic.c: Include gthreadinit.h here to see the declaration
	for _g_atomic_thread_init().
This commit is contained in:
Matthias Clasen 2004-08-02 15:34:30 +00:00 committed by Matthias Clasen
parent 76ce9fcb1b
commit f1024215a4
14 changed files with 117 additions and 15 deletions

View File

@ -1,5 +1,20 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
declarations as internal and avoid PLT indirections for
them. (#145465, Arjan van de Ven)
* glib/gunicodeprivate.h:
* glib/gthreadinit.h:
* glib/gmessages.h:
* glib/gdebug.h:
* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
_g_messages_thread_init(), _g_convert_thread_init(),
_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
_g_mem_thread_private_init(), _g_messages_thread_private_init(),
_g_utf8_normalize_wc() and _g_unichar_combining_class().
* glib/gatomic.c: Include gthreadinit.h here to see the declaration
for _g_atomic_thread_init().

View File

@ -1,5 +1,20 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
declarations as internal and avoid PLT indirections for
them. (#145465, Arjan van de Ven)
* glib/gunicodeprivate.h:
* glib/gthreadinit.h:
* glib/gmessages.h:
* glib/gdebug.h:
* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
_g_messages_thread_init(), _g_convert_thread_init(),
_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
_g_mem_thread_private_init(), _g_messages_thread_private_init(),
_g_utf8_normalize_wc() and _g_unichar_combining_class().
* glib/gatomic.c: Include gthreadinit.h here to see the declaration
for _g_atomic_thread_init().

View File

@ -1,5 +1,20 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
declarations as internal and avoid PLT indirections for
them. (#145465, Arjan van de Ven)
* glib/gunicodeprivate.h:
* glib/gthreadinit.h:
* glib/gmessages.h:
* glib/gdebug.h:
* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
_g_messages_thread_init(), _g_convert_thread_init(),
_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
_g_mem_thread_private_init(), _g_messages_thread_private_init(),
_g_utf8_normalize_wc() and _g_unichar_combining_class().
* glib/gatomic.c: Include gthreadinit.h here to see the declaration
for _g_atomic_thread_init().

View File

@ -1,5 +1,20 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
declarations as internal and avoid PLT indirections for
them. (#145465, Arjan van de Ven)
* glib/gunicodeprivate.h:
* glib/gthreadinit.h:
* glib/gmessages.h:
* glib/gdebug.h:
* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
_g_messages_thread_init(), _g_convert_thread_init(),
_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
_g_mem_thread_private_init(), _g_messages_thread_private_init(),
_g_utf8_normalize_wc() and _g_unichar_combining_class().
* glib/gatomic.c: Include gthreadinit.h here to see the declaration
for _g_atomic_thread_init().

View File

@ -1,5 +1,20 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Add a G_GNUC_INTERNAL macro to mark function
declarations as internal and avoid PLT indirections for
them. (#145465, Arjan van de Ven)
* glib/gunicodeprivate.h:
* glib/gthreadinit.h:
* glib/gmessages.h:
* glib/gdebug.h:
* glib/gconvert.c: Use G_GNUC_INTERNAL for _g_charset_get_aliases(),
_g_debug_init(), _g_log_fallback_handler(), _g_mem_thread_init(),
_g_messages_thread_init(), _g_convert_thread_init(),
_g_rand_thread_init(), _g_main_thread_init(), _g_atomic_thread_init(),
_g_mem_thread_private_init(), _g_messages_thread_private_init(),
_g_utf8_normalize_wc() and _g_unichar_combining_class().
* glib/gatomic.c: Include gthreadinit.h here to see the declaration
for _g_atomic_thread_init().

View File

@ -1,3 +1,8 @@
2004-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/glib-sections.txt:
* glib/tmpl/macros_misc.sgml: Document G_GNUC_INTERNAL.
2004-08-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.1 ===

View File

@ -319,6 +319,7 @@ G_GNUC_FORMAT
G_GNUC_FUNCTION
G_GNUC_PRETTY_FUNCTION
G_GNUC_NO_INSTRUMENT
G_GNUC_INTERNAL
<SUBSECTION>
G_LIKELY

View File

@ -250,6 +250,16 @@ See the GNU C documentation for details.
</para>
<!-- ##### MACRO G_GNUC_INTERNAL ##### -->
<para>
Expands to the GNU C <literal>visibility(hidden)</literal> attribute if the
compiler is <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.
</para>
Since: 2.6
<!-- ##### MACRO G_LIKELY ##### -->
<para>

View File

@ -90,7 +90,7 @@ try_to_aliases (const char **to_aliases,
return FALSE;
}
extern const char **_g_charset_get_aliases (const char *canonical_name);
extern const char **_g_charset_get_aliases (const char *canonical_name) G_GNUC_INTERNAL;
/**
* g_iconv_open:

View File

@ -53,7 +53,7 @@ typedef enum {
GLIB_VAR gboolean _g_debug_initialized;
GLIB_VAR guint _g_debug_flags;
void _g_debug_init ();
void _g_debug_init () G_GNUC_INTERNAL;
#ifdef __cplusplus
}

View File

@ -54,6 +54,17 @@
#define G_GNUC_PURE
#endif
/*
* Provide G_GNUC_INTERNAL that is used for marking library
* functions as being used internally to the lib only, to not
* create inefficient PLT entries.
*/
#if defined (__GNUC__)
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
#else
#define G_GNUC_INTERNAL
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))

View File

@ -104,7 +104,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
void _g_log_fallback_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data);
gpointer unused_data) G_GNUC_INTERNAL;
#ifndef G_LOG_DOMAIN

View File

@ -27,16 +27,16 @@ G_BEGIN_DECLS
void g_thread_init_glib (void);
/* Are called from glib/gthread.c. May not contain g_private_new calls */
void _g_mem_thread_init (void);
void _g_messages_thread_init (void);
void _g_convert_thread_init (void);
void _g_rand_thread_init (void);
void _g_main_thread_init (void);
void _g_atomic_thread_init (void);
void _g_mem_thread_init (void) G_GNUC_INTERNAL;
void _g_messages_thread_init (void) 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;
/* Are called from glib/gthread.c. Must only contain g_private_new calls */
void _g_mem_thread_private_init (void);
void _g_messages_thread_private_init (void);
void _g_mem_thread_private_init (void) G_GNUC_INTERNAL;
void _g_messages_thread_private_init (void) G_GNUC_INTERNAL;
G_END_DECLS

View File

@ -27,8 +27,8 @@ G_BEGIN_DECLS
gunichar *_g_utf8_normalize_wc (const gchar *str,
gssize max_len,
GNormalizeMode mode);
gint _g_unichar_combining_class (gunichar uc);
GNormalizeMode mode) G_GNUC_INTERNAL;
gint _g_unichar_combining_class (gunichar uc) G_GNUC_INTERNAL;
G_END_DECLS