Add a new _GLIB_EXTERN macro for "extern"

This macro simply evaluates the "extern" unless it has been explicitly
defined to something else.

All of the version macros (including the unversioned deprecation markers
and GLIB_AVAILABLE_IN_ALL) now include _GLIB_EXTERN as part of their
definition.

G_INLINE has also been modified to use _GLIB_EXTERN where appropriate.

This macro should never be used outside of the gmacros.h/gversonmacros.h
headers.

The effect of this patch is that "extern" has now been added to all
functions declared in installed headers.  Strictly speaking, this is
something we should have had all along...

GLIB_VAR and GOBJECT_VAR have also been modified to use _GLIB_EXTERN on
non-Windows, instead of "extern" which they were using before.  The
eventual goal is to use the normal version/deprecation macros on
exported variables and drop GLIB_VAR but we need to see how this will
work on Windows before we go ahead with that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
This commit is contained in:
Ryan Lortie
2012-12-06 13:37:45 -05:00
parent ba1bdd0708
commit b91c476827
5 changed files with 33 additions and 29 deletions

View File

@@ -1155,7 +1155,7 @@ GParamSpec* g_param_spec_variant (const gchar *name,
# endif /* !GOBJECT_COMPILATION */
# endif /* !GOBJECT_STATIC_COMPILATION */
# else /* !G_PLATFORM_WIN32 */
# define GOBJECT_VAR extern
# define GOBJECT_VAR _GLIB_EXTERN
# endif /* !G_PLATFORM_WIN32 */
#endif /* GOBJECT_VAR */