From a07b57887dee43ca0e3cd33c319eaad8998e03fd Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 22 Dec 2017 15:03:07 +0000 Subject: [PATCH] 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 --- glib/gmacros.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/glib/gmacros.h b/glib/gmacros.h index 353367764..430a3fbb7 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -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__ */ -- 2.11.4.GIT