Do not expand autoptr macros when running introspection

The introspection scanner chokes fairly badly on the types we create,
and that got even worse when the autolist support landed. Now, every
time we declare a new GObject type we automatically get incomplete
aliases to container types that gobject-introspection and Vala do not
know how to handle.

Since the autoptr machinery is not really introspectable to begin with,
as it's a C utility extension that depends on the C compiler being used
to compile a C project that depends on GLib, we can mark the whole
section as non-introspectable using the __GI_SCANNER__ pre-processor
symbol.

https://bugzilla.gnome.org/show_bug.cgi?id=791342
This commit is contained in:
Emmanuele Bassi 2017-12-22 15:03:07 +00:00
parent f49a93b207
commit a07b57887d

View File

@ -433,6 +433,8 @@
#define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN
#endif
#ifndef __GI_SCANNER__
#ifdef __GNUC__
/* these macros are private */
@ -484,6 +486,16 @@
#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
/* no declaration of g_auto() or g_autoptr() here */
#endif
#endif /* __GNUC__ */
#else
#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName)
#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)
#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
#endif /* __GI_SCANNER__ */
#endif /* __G_MACROS_H__ */